phpunit

PHPUnit_Framework_TestCase class is not available. Fix… - Makegood , Eclipse

試著忘記壹切 提交于 2020-01-24 12:47:47
问题 I am working in OSX 10.11 I am trying to setup PHPUnit , MAKEGood and Xdebug with Eclipse . XDebug is Done . I can Run PHPUnit tests form the console . But now configuring MakeGood is lot more harder than i expected . MY PHP Executables Do i have to add pear in Eclipse->Preferences->PHP->Libraries ?? i am not sure because i installed PHPUnit using Brew. brew install homebrew/php/phpunit But again i tried to include PEAR . I gave the path as usr/local/bin because when i try which pear in

Laravel - CircleCI - Fails on phpunit

亡梦爱人 提交于 2020-01-24 09:13:40
问题 I have started the process of making use on Continuous Integration and I have decided on circleci. Please let me know if I can supply any other information as I am lost at this point. When circleci tries to run the phpunit command it returns the following error: I have failed miserably at solving this issue. vendor/bin/phpunit PHPUnit 3.7.37 by Sebastian Bergmann. Configuration read from /home/ubuntu/simple/phpunit.xml PHP Fatal error: Class 'Illuminate\View\Environment' not found in /home

Laravel - CircleCI - Fails on phpunit

僤鯓⒐⒋嵵緔 提交于 2020-01-24 09:13:08
问题 I have started the process of making use on Continuous Integration and I have decided on circleci. Please let me know if I can supply any other information as I am lost at this point. When circleci tries to run the phpunit command it returns the following error: I have failed miserably at solving this issue. vendor/bin/phpunit PHPUnit 3.7.37 by Sebastian Bergmann. Configuration read from /home/ubuntu/simple/phpunit.xml PHP Fatal error: Class 'Illuminate\View\Environment' not found in /home

PHPUnit and Globals

我的未来我决定 提交于 2020-01-22 18:46:13
问题 I am learning and exploring applications of PHPUnit with PHP 5.2.9 and have run into the globals issue. I have set $backupGlobals to FALSE, included the doc '@backupGlobals disabled' and this doesn't seem to affect the behaviour of PHPUnit's backing up of the globals. Is there something I'm missing? Do I need to alter PHPUnit's xml file? Create a bootstrap? config.php: $testString = 'Hello world!'; basicApp.php: require ('D:\data\clients\security.ca\web_sites\QRASystems.com\wwwroot\__tests

Sending a POST request with PHPUnit

China☆狼群 提交于 2020-01-22 15:20:12
问题 I have a symfony website, and Im trying to do some unit testing. I have this kind of test where I try to submit something: <?php namespace Acme\AcmeBundle\Tests\Controller; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class HomeControllerTest extends WebTestCase { public function testrandomeThings() { $client = static::createClient(); $crawler = $client->request( 'POST', '/', array( "shopNumber" => 0099, "cardNumber" => 231, "cardPIN" => "adasd"), array(), array()); } but I dont think

How to display underlying tested method in PHPUnit tests?

Deadly 提交于 2020-01-22 12:16:06
问题 I have test suites with lots of tests in them. here is a medium sized one: ok 4 - CommodityBasketTest::testStartsOutEmpty ok 5 - CommodityBasketTest::testCanAddACommodity ok 6 - CommodityBasketTest::testWillAddOneCommodityByDefault ok 7 - CommodityBasketTest::testCannotAddACommodityWithAnNonNumericQuantity ok 8 - CommodityBasketTest::testAddingTheSameCommodityWillIncreaseItsQuantity ok 9 - CommodityBasketTest::testMultipleCommodityCanBeAdded ok 10 - CommodityBasketTest:

How to display underlying tested method in PHPUnit tests?

一曲冷凌霜 提交于 2020-01-22 12:15:47
问题 I have test suites with lots of tests in them. here is a medium sized one: ok 4 - CommodityBasketTest::testStartsOutEmpty ok 5 - CommodityBasketTest::testCanAddACommodity ok 6 - CommodityBasketTest::testWillAddOneCommodityByDefault ok 7 - CommodityBasketTest::testCannotAddACommodityWithAnNonNumericQuantity ok 8 - CommodityBasketTest::testAddingTheSameCommodityWillIncreaseItsQuantity ok 9 - CommodityBasketTest::testMultipleCommodityCanBeAdded ok 10 - CommodityBasketTest:

How do I run all my PHPUnit tests?

 ̄綄美尐妖づ 提交于 2020-01-22 04:34:21
问题 I have script called Script.php and tests for it in Tests/Script.php, but when I run phpunit Tests it does not execute any tests in my test file. How do I run all my tests with phpunit? PHPUnit 3.3.17, PHP 5.2.6-3ubuntu4.2, latest Ubuntu Output: $ phpunit Tests PHPUnit 3.3.17 by Sebastian Bergmann. Time: 0 seconds OK (0 tests, 0 assertions) And here are my script and test files: Script.php <?php function returnsTrue() { return TRUE; } ?> Tests/Script.php <?php require_once 'PHPUnit/Framework

catching ArgumentCountError and PHPUnit_Framework_Error_Warning

可紊 提交于 2020-01-21 12:14:51
问题 Someone submitted a pull request to a library of mine wherein a parameter was made optional by replacing something like function doSomething($var) with function doSomething($var = 'whatever') . So I added a unit test to make sure that an error would be issued if you didn't pass enough variables to the method. To catch this I was using the PHPUnit annotation @expectedException . For PHP 7.0 the expected exception is PHPUnit_Framework_Error_Warning but for PHP 7.1+ the expected exception is

catching ArgumentCountError and PHPUnit_Framework_Error_Warning

这一生的挚爱 提交于 2020-01-21 12:11:37
问题 Someone submitted a pull request to a library of mine wherein a parameter was made optional by replacing something like function doSomething($var) with function doSomething($var = 'whatever') . So I added a unit test to make sure that an error would be issued if you didn't pass enough variables to the method. To catch this I was using the PHPUnit annotation @expectedException . For PHP 7.0 the expected exception is PHPUnit_Framework_Error_Warning but for PHP 7.1+ the expected exception is