• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
testing with phpunit in phpstorm

currently im trying to get phpunit run all tests ( include own application tests ) in phpstorm.

1. install all dependency via composer
  ( got an error on extractTo phpunit/php-code-coverage : no such file or stream | and git was not found : github.com/sebastianbergmann/php-code-coverage.git ) -> guess i dont need this for testing, so just as notice

2. download phpunit.phar and select it in Settings/Languages&Frameworks/PHP/TestFramework

when i try to run a test without the configuration file i get :
   Fatal error: Class 'CodeIgniter\Test\CIDatabaseTestCase' not found

when i try to run a test with the configuration file ( phpunit.xml.dist ) i get :
  require(application/Config/Paths.php): failed to open stream [...] \tests\_support\_bootstrap.php on line 10

im very new to phpunit - so maybe i miss some phpstorm configuration, but when i use the build-in test creation it work ( but i dont get codeignigter to run in a TestCase class )

thx for reading - hope someone had the same problems and solved it^^

I found that with phpStorm it's a good idea to add a url mapping to the public folder.
What did you Try? What did you Get? What did you Expect?

Joined the CodeIgniter Community in 2009.          ( Skype: insitfx )

I do not know how to configure it with the PhpStorm GUI.

But is possible just go to you CodeIgniter 4 root dir with the terminal and run: ./phpunit

If you want to test a specific file: ./phpunit tests/system/CLI/CLITest.php

hmm, i test it but i get many errors like : "Uncaught ErrorException: Undefined index [...] \TestLogger.php:35"
so the testing suit is broken ? i thougth it have to work out of the box ( as it works in the travis builds )

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

Users browsing this thread:
1 Guest(s)

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.