theseer / Autoload

A lightweight php namespace aware autoload generator and phar archive builder
Other
388 stars 47 forks source link

fix PathComparator when 0 in path #66

Closed remicollet closed 9 years ago

remicollet commented 9 years ago

Discover trying to build 1.20.1 , where dirname is commit ref, so with 0

 1) TheSeer\Autoload\Tests\PathComparatorTest::testComparatorYieldsCorrectCommonBase with data set "single" (array('/dev/shm/BUILD/Autoload-63813.../tests'), '/dev/shm/BUILD/Autoload-63813.../tests')
 Failed asserting that two strings are equal.
 --- Expected
 +++ Actual
 @@ @@
 -'/dev/shm/BUILD/Autoload-63813ec60cdfe966de8577e06aed40cd9a1720d8/tests'
 +'/dev/shm/BUILD/Autoload-63813ec6'

 /dev/shm/BUILD/Autoload-63813ec60cdfe966de8577e06aed40cd9a1720d8/tests/PathComparator.test.php:14

 2) TheSeer\Autoload\Tests\PathComparatorTest::testComparatorYieldsCorrectCommonBase with data set "two" (array('/dev/shm/BUILD/Autoload-63813.../tests', '/dev/shm/BUILD/Autoload-63813...1720d8'), '/dev/shm/BUILD/Autoload-63813...1720d8')
 Failed asserting that two strings are equal.
 --- Expected
 +++ Actual
 @@ @@
 -'/dev/shm/BUILD/Autoload-63813ec60cdfe966de8577e06aed40cd9a1720d8'
 +'/dev/shm/BUILD/Autoload-63813ec6'

 /dev/shm/BUILD/Autoload-63813ec60cdfe966de8577e06aed40cd9a1720d8/tests/PathComparator.test.php:14

 3) TheSeer\Autoload\Tests\PathComparatorTest::testComparatorYieldsCorrectCommonBase with data set "partns" (array('/dev/shm/BUILD/Autoload-63813...../src', '/dev/shm/BUILD/Autoload-63813...heseer'), '/dev/shm/BUILD/Autoload-63813...1720d8')
 Failed asserting that two strings are equal.
 --- Expected
 +++ Actual
 @@ @@
 -'/dev/shm/BUILD/Autoload-63813ec60cdfe966de8577e06aed40cd9a1720d8'
 +''

 /dev/shm/BUILD/Autoload-63813ec60cdfe966de8577e06aed40cd9a1720d8/tests/PathComparator.test.php:14
remicollet commented 9 years ago

And CS issue fixed for free ;)

theseer commented 9 years ago

I hate PHP's empty() function ... Thank you!