Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8606875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:12:13+00:00 2026-06-12T03:12:13+00:00

I read that PHPUnit can be installed with pear or with composer. Because I’m

  • 0

I read that PHPUnit can be installed with pear or with composer.
Because I’m on a windows with WAMPSERVER and a cygwin for console stuff and there is no pear installed, I installed PHPUnit via composer. And especially since symfony2.1 you must use composer, so I choose this method.

I add this into my composer.json

"require-dev": {
    "phpunit/phpunit": "3.7.*"
},

And then do a

php composer.phar install --dev

//Update1 (thanks to theunraveler)

The bin files (phpunit and phpunit.bat) are copied or linked to the bin directory of the app. But when I call bin/phpunit -c app/
I get this error:

Fatal error: Cannot redeclare assetic_init() (previously declared in C:\wamp_\www\symfony2.1\vendor\kriswallsmith\assetic\src\functions.php:20) in C:\wamp_\www\symfony2.1\vendor\kriswallsmith\assetic\src\functions.php on line 26

Call Stack:
    0.0005     128056   1. {main}() C:\wamp_\www\symfony2.1\vendor\phpunit\phpunit\composer\bin\phpunit:0
    0.0095     433520   2. PHPUnit_TextUI_Command::main() C:\wamp_\www\symfony2.1\vendor\phpunit\phpunit\composer\bin\phpunit:42
    0.0096     436736   3. PHPUnit_TextUI_Command->run() C:\wamp_\www\symfony2.1\vendor\phpunit\phpunit\PHPUnit\TextUI\Command.php:130
    0.0096     436952   4. PHPUnit_TextUI_Command->handleArguments() C:\wamp_\www\symfony2.1\vendor\phpunit\phpunit\PHPUnit\TextUI\Command.php:139
    0.0144     683168   5. PHPUnit_TextUI_Command->handleBootstrap() C:\wamp_\www\symfony2.1\vendor\phpunit\phpunit\PHPUnit\TextUI\Command.php:615
    0.0148     689328   6. PHPUnit_Util_Fileloader::checkAndLoad() C:\wamp_\www\symfony2.1\vendor\phpunit\phpunit\PHPUnit\TextUI\Command.php:787
    0.0152     689448   7. PHPUnit_Util_Fileloader::load() C:\wamp_\www\symfony2.1\vendor\phpunit\phpunit\PHPUnit\Util\Fileloader.php:77
    0.0200    1013688   8. include_once('C:\wamp_\www\symfony2.1\app\bootstrap.php.cache') C:\wamp_\www\symfony2.1\vendor\phpunit\phpunit\PHPUnit\Util\Fileloader.php:93
    0.0202    1016424   9. require_once('C:\wamp_\www\symfony2.1\app\autoload.php') C:\wamp_\www\symfony2.1\app\bootstrap.php.cache:3
    0.0204    1017424  10. require('C:\wamp_\www\symfony2.1\vendor\autoload.php') C:\wamp_\www\symfony2.1\app\autoload.php:5
    0.0205    1017440  11. ComposerAutoloaderInit::getLoader() C:\wamp_\www\symfony2.1\vendor\autoload.php:7

PHP Fatal error:  Cannot redeclare assetic_init() (previously declared in C:\wamp_\www\symfony2.1\vendor\kriswallsmith\assetic\src\functions.php:20) in C:\wamp_\www\symfony2.1\vendor\kriswallsmith\assetic\src\functions.php on line 26
PHP Stack trace:
PHP   1. {main}() C:\wamp_\www\symfony2.1\vendor\phpunit\phpunit\composer\bin\phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() C:\wamp_\www\symfony2.1\vendor\phpunit\phpunit\composer\bin\phpunit:42
PHP   3. PHPUnit_TextUI_Command->run() C:\wamp_\www\symfony2.1\vendor\phpunit\phpunit\PHPUnit\TextUI\Command.php:130
PHP   4. PHPUnit_TextUI_Command->handleArguments() C:\wamp_\www\symfony2.1\vendor\phpunit\phpunit\PHPUnit\TextUI\Command.php:139
PHP   5. PHPUnit_TextUI_Command->handleBootstrap() C:\wamp_\www\symfony2.1\vendor\phpunit\phpunit\PHPUnit\TextUI\Command.php:615
PHP   6. PHPUnit_Util_Fileloader::checkAndLoad() C:\wamp_\www\symfony2.1\vendor\phpunit\phpunit\PHPUnit\TextUI\Command.php:787
PHP   7. PHPUnit_Util_Fileloader::load() C:\wamp_\www\symfony2.1\vendor\phpunit\phpunit\PHPUnit\Util\Fileloader.php:77
PHP   8. include_once() C:\wamp_\www\symfony2.1\vendor\phpunit\phpunit\PHPUnit\Util\Fileloader.php:93
PHP   9. require_once() C:\wamp_\www\symfony2.1\app\bootstrap.php.cache:3
PHP  10. require() C:\wamp_\www\symfony2.1\app\autoload.php:5
PHP  11. ComposerAutoloaderInit::getLoader() C:\wamp_\www\symfony2.1\vendor\autoload.php:7

Why this will be executed, I don’t define to search for tests in this directory.
I try to remove the file where the error occurs, but then I get a similar error: cannot redeclare error for another class/function. So it looks like the source is been loaded twice.

//Update2
The phpunit.xml.dist was generated when I install symfony, I didn’T modify it.

<?xml version="1.0" encoding="UTF-8"?>

<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html -->
<phpunit
    backupGlobals               = "false"
    backupStaticAttributes      = "false"
    colors                      = "true"
    convertErrorsToExceptions   = "true"
    convertNoticesToExceptions  = "true"
    convertWarningsToExceptions = "true"
    processIsolation            = "false"
    stopOnFailure               = "false"
    syntaxCheck                 = "false"
    bootstrap                   = "bootstrap.php.cache" >

    <testsuites>
        <testsuite name="Project Test Suite">
            <directory>../src/*/*Bundle/Tests</directory>
            <directory>../src/*/Bundle/*Bundle/Tests</directory>
        </testsuite>
    </testsuites>

    <!--
    <php>
        <server name="KERNEL_DIR" value="/path/to/your/app/" />
    </php>
    -->

    <filter>
        <whitelist>
            <directory>../src</directory>
            <exclude>
                <directory>../src/*/*Bundle/Resources</directory>
                <directory>../src/*/*Bundle/Tests</directory>
                <directory>../src/*/Bundle/*Bundle/Resources</directory>
                <directory>../src/*/Bundle/*Bundle/Tests</directory>
            </exclude>
        </whitelist>
    </filter>

</phpunit>

The errors still there when I delete the testsuites and filter block.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T03:12:15+00:00Added an answer on June 12, 2026 at 3:12 am

    I just tried this, and a symlink was created in my project’s bin directory. So I was able to run PHPUnit with bin/phpunit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I read that because of the dequeueReusableCellWithIdentifier method grabbing an oldCell if there is
I read that MySQL fulltext search can cause table locking . It means people
I read that Windows wp8 allows native code. So how then have ports such
I read that compiler can enforce dbc at compile time.. How does it do
I read that one can support query by humming by using MIDI files. Can
I read that C2DM uses port 5228 for connection. Is there a ping address
I read that each column of a table can be styled using <colgroup> and
I read that in PHP, you can view all the cookies by using print_r,
I read that SVG animatable properties like transform can be animated by CSS transitions.
I read that you can pass an array as a parameter to a method

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.