Laravel Classroom image

Anil  Bist / Professional / Web Technology

 
To post your Question Join Classroom
 
Lesson Topics's No:-  First|1 | 2 | 3 | 4|Last
Lessons:-Unit Testing

16.3 Running Tests
Tests can be ran using the Artisan command line interface. Simply use the test command to
run all test cases.
1 php artisan test
and the result..
1 PHPUnit 3.6.10 by Sebastian Bergmann.
2
3 Configuration read from /home/daylerees/www/laravel/develop/phpunit.xml
4
5 .
6
7 Time: 0 seconds, Memory: 6.25Mb
8
9 OK (1 test, 1 assertion)
With the OK part appearing in bright green to show us that the tests have passed.
Of course we knew that the test would succeed because we are using the assertTrue() method
to check the value true. There is no way it could fail.
Let’s bully the test so that it will fail, we will simply change the parameter to false.
1 ...
2 $this->assertTrue(false);
3 ...
and the result :1 PHPUnit 3.6.10 by Sebastian Bergmann.
2
3 Configuration read from /home/daylerees/www/laravel/develop/phpunit.xml
4
5 F
6
7 Time: 0 seconds, Memory: 6.50Mb
8
9 There was 1 failure:
10
11 1) TestExample::testSomethingIsTrue
12 Failed asserting that false is true.
13
14 /home/daylerees/www/laravel/develop/application/tests/example.test.php:12
15 /usr/bin/phpunit:46
16
17 FAILURES!
18 Tests: 1, Assertions: 1, Failures: 1.
Now we have some bright red lines to indicate that the tests have failed, including some details
about why the test failed.
If we wanted to test a bundle we would simply pass the bundle name as a parameter to the test
command, for example.
1 php artisan test mybundle

 
 
 
image
Anil  Bist

Skills    Laravel

Qualifications :- High School - SLV, College/University - Graphic Era Deemed Univ University,
Location :-Dehradun,Dehradun,Uttarakhand,India
Description:-

I started my Professional Journey in 2006 with one of the Web Development Company in Bangalore and my 1st framework was "Ruby on Rail" as Web development and delivered around 5+ Projects using this platform. Then came another dimension as JEE/Sturst framework, Gradually I realized that I want to build something on my own and give my passion and energy on creating something different a
Explore

 

  Students (0)