From 832337fbf33ef28c44d269c0ea99c675af191b12 Mon Sep 17 00:00:00 2001 From: Alexander Wozniak Date: Mon, 30 Nov 2020 13:15:48 +0100 Subject: [PATCH] Fix Zend_Form_ElementTest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The behaviour hasn't really changed because the intent of the test is to use an array of arrays in setOptions. What has changed is that PHP 8.0 supports calling functions with named parameters and will throw a Fatal if you try to access a parameter by name that does not exist. Digits::__construct has no param named bar ergo we get a Fatal. Signed-off-by: Alexander Wozniak Signed-off-by: Elan Ruusamäe --- tests/Zend/Form/ElementTest.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/Zend/Form/ElementTest.php b/tests/Zend/Form/ElementTest.php index b1dd91254..4283d8254 100644 --- a/tests/Zend/Form/ElementTest.php +++ b/tests/Zend/Form/ElementTest.php @@ -48,6 +48,11 @@ */ class Zend_Form_ElementTest extends PHPUnit_Framework_TestCase { + /** + * @var Zend_Form_Element + */ + private $element; + public static function main() { $suite = new PHPUnit_Framework_TestSuite('Zend_Form_ElementTest'); @@ -1760,12 +1765,12 @@ public function testSetOptionsSetsArrayOfArrayFilters() $options = $this->getOptions(); $options['filters'] = array( - array('Digits', array('bar' => 'baz')), + array('Alnum', array('allowWhiteSpace' => true)), array('Alpha', array('foo')), ); $this->element->setOptions($options); - $filter = $this->element->getFilter('Digits'); - $this->assertTrue($filter instanceof Zend_Filter_Digits); + $filter = $this->element->getFilter('Alnum'); + $this->assertTrue($filter instanceof Zend_Filter_Alnum); $filter = $this->element->getFilter('Alpha'); $this->assertTrue($filter instanceof Zend_Filter_Alpha); }