Jump to:

4949 Posts in 13873 Topics by 1489 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » [SOLVED] Please install PHPUnit using pear

Getting SilverStripe up and running on your computer and on your web server.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 2479 Views
  • chrclaus
    Avatar
    Community Member
    29 Posts

    [SOLVED] Please install PHPUnit using pear Link to this post

    Hello,

    I want to write testcases but I am not able to get PHPUnit started. I searched this and other forums and read different installation manuals. I checked the config and path entries but by calling http://localhost/dev/tests in my browser I get the error

    Please install PHPUnit using pear


    Using phpunit in command line mode without any parameters I get the usage informations. Calling

    phpUnit sapphire/tests/


    shows me the error

    sapphire/tests/.php could not be found or is not readable

    I´m using xampp 1.7.0 (Apache 2.2.11 and PHP 5.2.8 MySql 5.1.30) on WindowsXP.

    I checked the config-files php.ini and pear.ini several times but I did not find any inconsistence between the manual, forum entries and my config. Can anybody help me?

    Best regards,
    chrclaus

  • Willr
    Avatar
    Forum Moderator
    5482 Posts

    Re: [SOLVED] Please install PHPUnit using pear Link to this post

    To run the tests you should use sake or via a webbrowser hitting the url http://yoursite.com/dev/tests/ or sake dev/tests. Running the tests directly through phpunit is something Ingo has just got working, don't know if this has made general release yet though!

  • chrclaus
    Avatar
    Community Member
    29 Posts

    Re: [SOLVED] Please install PHPUnit using pear Link to this post

    Hi Willr,

    this was my first guess but I am receiving the error

    Please install PHPUnit using pear

    After this I tried out other possibilities to verify PHPUnit. But running the tests via browser is the way I want to use.

    Best regards,
    chrclaus

  • Willr
    Avatar
    Forum Moderator
    5482 Posts

    Re: [SOLVED] Please install PHPUnit using pear Link to this post

    What happens if you call the following in your terrminal window

    PHPUnit --version

    If PHPUnit is not available then it may not have been installed correctly. Try following the installation steps again - from http://doc.silverstripe.org/sapphire/en/topics/testing

  • chrclaus
    Avatar
    Community Member
    29 Posts

    Re: [SOLVED] Please install PHPUnit using pear Link to this post

    Hi Willr,

    C:\xampp>phpunit --version
    PHPUnit 2.3.6 by Sebastian Bergmann.

    C:\xampp>

    I followed these installation steps several times, but the result remains the same: -> Please install PHPUnit using pear

    Best regards,
    chrclaus

  • Willr
    Avatar
    Forum Moderator
    5482 Posts

    Re: [SOLVED] Please install PHPUnit using pear Link to this post

    It is possible that your PHPUnit is too old for SilverStripe. I'm using 3.4.3 so 2.3.6 must be quite old.

  • chrclaus
    Avatar
    Community Member
    29 Posts

    Re: [SOLVED] Please install PHPUnit using pear Link to this post

    Hi Willr,

    that´s it! A missing channel blocked the whole update. After fixing the channel-config and upgrading to PHPUnit-version 3.5.10 I´m able to run tests. Thank you very much.

    Best regards,
    chrclaus

  • wildflower1975
    Avatar
    Community Member
    59 Posts

    Re: [SOLVED] Please install PHPUnit using pear Link to this post

    I'm using Ubuntu and had to run
    <code>
    sudo apt-get install phpunit
    </code>
    instead of installing it via pear to get it to work

    HTH

    2479 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.