From 3ae21ce511afec32f5ee569e9715ca3727fc352f Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Thu, 27 Oct 2016 01:53:38 -0700 Subject: [PATCH] PHP 7.0 warnings fix: don't pass rvalue by reference. Signed-off-by: Edward Z. Yang --- tests/HTMLPurifier/AttrValidator_ErrorsTest.php | 3 ++- tests/HTMLPurifier/DefinitionCacheFactoryTest.php | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/HTMLPurifier/AttrValidator_ErrorsTest.php b/tests/HTMLPurifier/AttrValidator_ErrorsTest.php index 07e25301..98693afb 100644 --- a/tests/HTMLPurifier/AttrValidator_ErrorsTest.php +++ b/tests/HTMLPurifier/AttrValidator_ErrorsTest.php @@ -10,7 +10,8 @@ class HTMLPurifier_AttrValidator_ErrorsTest extends HTMLPurifier_ErrorsHarness $this->language = HTMLPurifier_LanguageFactory::instance()->create($config, $this->context); $this->context->register('Locale', $this->language); $this->collector = new HTMLPurifier_ErrorCollector($this->context); - $this->context->register('Generator', new HTMLPurifier_Generator($config, $this->context)); + $gen = new HTMLPurifier_Generator($config, $this->context); + $this->context->register('Generator', $gen); } protected function invoke($input) diff --git a/tests/HTMLPurifier/DefinitionCacheFactoryTest.php b/tests/HTMLPurifier/DefinitionCacheFactoryTest.php index fe27e0d5..b1ca27a0 100644 --- a/tests/HTMLPurifier/DefinitionCacheFactoryTest.php +++ b/tests/HTMLPurifier/DefinitionCacheFactoryTest.php @@ -30,7 +30,8 @@ class HTMLPurifier_DefinitionCacheFactoryTest extends HTMLPurifier_Harness $this->factory->addDecorator('Memory'); $cache = $this->factory->create('Test', $this->config); $cache_real = new HTMLPurifier_DefinitionCache_Decorator_Memory(); - $cache_real = $cache_real->decorate(new HTMLPurifier_DefinitionCache_Serializer('Test')); + $ser = new HTMLPurifier_DefinitionCache_Serializer('Test'); + $cache_real = $cache_real->decorate($ser); $this->assertEqual($cache, $cache_real); } @@ -39,7 +40,8 @@ class HTMLPurifier_DefinitionCacheFactoryTest extends HTMLPurifier_Harness $this->factory->addDecorator(new HTMLPurifier_DefinitionCache_Decorator_Memory()); $cache = $this->factory->create('Test', $this->config); $cache_real = new HTMLPurifier_DefinitionCache_Decorator_Memory(); - $cache_real = $cache_real->decorate(new HTMLPurifier_DefinitionCache_Serializer('Test')); + $ser = new HTMLPurifier_DefinitionCache_Serializer('Test'); + $cache_real = $cache_real->decorate($ser); $this->assertEqual($cache, $cache_real); } -- 2.11.4.GIT