Created
November 6, 2018 03:26
-
-
Save sameernyaupane/c356fe1373c28132d59c33194a1e12c4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tests\Integration; | |
use Tests\TestCase; | |
class MathTest extends TestCase | |
{ | |
public function setUp() | |
{ | |
parent::setUp(); | |
$this->math = $this->app->make('App\Math'); | |
} | |
public function test_getArea_WhenCalledWithLength2_Return4() | |
{ | |
$response = $this->math->getArea(2); | |
$this->assertTrue(is_int($response)); | |
$this->assertEquals(4, $response); | |
} | |
public function test_getArea_WhenCalledWithLength6_Return36() | |
{ | |
$length = 6; | |
$response = $this->math->getArea($length); | |
$this->assertTrue(is_int($response)); | |
$this->assertEquals(36, $response); | |
} | |
public function test_getArea_WhenCalledWithoutLength_ThrowAnException() | |
{ | |
$this->expectException('ArgumentCountError'); | |
$this->expectExceptionMessage('Too few arguments to function'); | |
$this->math->getArea(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment