Issues

ZF-9742: testPropertyDefaultValueCanHandleComplexArrayOfTypes() fails

Issue Type: Unit Tests: Problem Created: 2010-04-24T03:32:35.000+0000 Last Updated: 2012-04-28T18:39:13.000+0000 Status: Resolved Fix version(s): - 1.12.0 (27/Aug/12)

Reporter: Jan Pieper (jpieper) Assignee: Rob Allen (rob) Tags: - Zend_CodeGenerator

Related issues: Attachments: - DefaultValueTest.php.patch

Description

Used Zend Framework from trunk (1.11.0dev).

<pre class="highlight">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.


<pre class="highlight">

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

Posted by Jan Pieper (jpieper) on 2010-04-24T03:46:16.000+0000

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

Posted by Kim Blomqvist (kblomqvist) on 2011-04-24T20:28:59.000+0000

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

Posted by Martin Hujer (mhujer) on 2012-04-26T19:05:42.000+0000

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.

Posted by Martin Hujer (mhujer) on 2012-04-26T19:06:34.000+0000

Attaching patch - use PHP_EOL in the expected code.

Posted by Rob Allen (rob) on 2012-04-28T18:15:15.000+0000

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

Posted by Martin Hujer (mhujer) on 2012-04-28T18:39:13.000+0000

Fine, it works now.

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts