Advertisement
SMASIF

CSE435 PROJECT

Apr 2nd, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.28 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Tests\Unit;
  4.  
  5. use Tests\TestCase;
  6. use Illuminate\Foundation\Testing\WithFaker;
  7. use App\Stadium;
  8. use App\Player;
  9. use App\Match;
  10. use App\Team;
  11.  
  12. use Illuminate\Foundation\Testing\RefreshDatabase;
  13.  
  14. class FifaTest extends TestCase
  15. {
  16.     /**
  17.      * A basic test example.
  18.      *
  19.      * @return void
  20.      */
  21.  
  22.     public function testCountStadium()
  23.     {
  24.         $this->assertEquals(12, Stadium::count());
  25.     }
  26.  
  27.     public function testDb()
  28.     {
  29.         $stadium = Stadium::first();
  30.         $this->assertEquals($stadium['name'], $stadium->name);
  31.         $this->assertEquals($stadium['city'], $stadium->city);
  32.     }
  33.    
  34.     public function testPlayerName()
  35.     {
  36.         $player = new Player(['name'=>'Lionel Messi']);
  37.         $this->assertEquals('Lionel Messi', $player->name);
  38.     }
  39.     public function testPlayerNameCaseSensitivity()
  40.     {
  41.         $player = new Player(['name'=>'lionel Messi']);
  42.         $this->assertNotEquals('Lionel Messi', $player->name);
  43.     }
  44.     public function testPlayerNameBlank()
  45.     {
  46.         $player = new Player(['name'=>'']);
  47.         $this->assertNotEquals('Lionel Messi', $player->name);
  48.     }
  49.  
  50.     public function testPlayerAge()
  51.     {
  52.         $player = new Player(['age'=>'31']);
  53.         $this->assertEquals('31', $player->age);
  54.     }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement