How do I run PHPUnit in Laravel from my Windows Command prompt
How do I run PHPUnit in Laravel from my Windows Command prompt
I have a Laravel app installed in my directory f:lara_app. I use PHP artisan serve to run the app. I have Laravel version 5.4.36 (via Composer Install)
I am not trying my hand in using the PHP Unit to do testing. Inside f:/lara_app/tests/Unit/ExampleTest.php, I have the following codes:
namespace TestsUnit;
use TestsTestCase;
use IlluminateFoundationTestingDatabaseMigrations;
use IlluminateFoundationTestingDatabaseTransactions;
class ExampleTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function testBasicTest()
{
$this->assertTrue(true);
}
public function myFirstTest()
{
$value = 'Hello World';
$this->assertTrue( 'Hello' === $value, 'Value should be Hello World');
}
}
I now try to run the test from my command prompt:
f:lara_app> .vendor/phpunit/phpuni/phpunit
But I'm getting the message below:
'.vendor' is not recognized as an internal or external command, operable program or batch file
How do I run the PHPUnit test?
Thanks in advance
.
1 Answer
1
This should work on windows
f:lara_app> php vendor/phpunit/phpunit/phpunit
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
your answer is in your question. why the
.
before vendor?– Wreigh
2 days ago