Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHPunit has spaces in progress bar dots

Tags:

phpunit

somewhere somehow i begun to get a dot with 4 spaces inside PHPUnit's progress bar and i don't understand how to set it back to normal. It's PHPUnit only, other shell scripts go ok. It looks like this

.    .    .    .    .    .    .    .    .    [...]  100 / 100 (100%)

Problem is not only with local machine because when i run the test on other machine, it also generates same progress bar with spaces between progress dots.

Maybe anybody has the clue where to fix it.

Some background information (but since i am getting same spaces on two different configurations, its something with files/phpunit and not dev env):

  • PHP Framework Laravel 4.0-dev
  • Test box 1: MacOSX 10.9, PHPUnit 3.7.28, PHP version 5.4.17
  • Test box 2: Ubuntu 13.04, PHPUnit 3.7.21, PHP 5.4.9-4ubuntu2.2
  • Both boxes env LANG: en_US.UTF-8
  • Both boxes env LC_CTYPE: UTF-8
  • Encoding for source file, test file and phpunit.xml - UTF-8
  • Command to launch tests: ~/> php ../bin/phpunit.phar -c phpunit.xml

phpunit.xml:

<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="bootstrap/autoload.php" processIsolation="false">
    <testsuites>
        <testsuite name="Application Test Suite">
            <directory>./app/tests/</directory>
        </testsuite>
    </testsuites>
</phpunit>

Freaking out. Its UTF-8 everywhere, PHPUnit doesn't have config for progress bar. what is happening.


EDIT/RESOLUTION:

Thanks to @Sven for the tip. Debugging the test step by step helped - i had lame \t char in the beginning of the db mock config file which is included as part of ::setUp(). To justify myself I just hope that anybody else will get here via google and find this annoying, yet tricky question useful.

like image 442
Edgar Zagórski Avatar asked Nov 11 '13 08:11

Edgar Zagórski


2 Answers

You probably echo out some spaces somewhere.

like image 99
Sven Avatar answered Jan 03 '23 11:01

Sven


For me, i was autoloading a config file that had a single leading space before the opening <?php tag

like image 30
myol Avatar answered Jan 03 '23 11:01

myol