Issues

ZF-9742: testPropertyDefaultValueCanHandleComplexArrayOfTypes() fails

Description

Used Zend Framework from trunk (1.11.0dev).

PHPUnit 3.4.11 by Sebastian Bergmann.

.....F

Time: 0 seconds, Memory: 4.00Mb

There was 1 failure:

1) Zend_CodeGenerator_Php_Property_DefaultValueTest::testPropertyDefaultValueCanHandleComplexArrayOfTypes
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
 array(
         5,
         'one' => 1,
         'two' => '2',
         array(
             'foo',
             'bar',
             array(
                 'baz1',
                 'baz2'
                 )
             ),
         PHP_EOL
         );

C:\Server\workspace\ZendFramework\tests\Zend\CodeGenerator\Php\Property\DefaultValueTest.php:124

FAILURES!
Tests: 6, Assertions: 7, Failures: 1.


PHP 5.2.10 (cli) (built: Jun 17 2009 16:16:57) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies```

Comments

Zend_CodeGenerator_Php_Property_DefaultValue::generate() uses PHP_EOL testPropertyDefaultValueCanHandleComplexArrayOfTypes() uses \n (Unix)

This is likely already fixed. As far as I understand {{testPropertyDefaultValueCanHandleComplexArrayOfTypes}} of Zend Framework version 1.11.5 uses PHP_EOL.

It still fails in latest trunk (r24717) on Windows.

The CodeGenerator puts proper PHP_EOL there, but the expected value is in Heredoc with Unix lineendings.

Attaching patch - use PHP_EOL in the expected code.

I've taken a different approach. Please re-test with svn r24730.

Fine, it works now.