Skip to content

Instantly share code, notes, and snippets.

@sameernyaupane
Last active May 20, 2021 22:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sameernyaupane/7cc8faaa3b9e33bcbb4fe313cda73a65 to your computer and use it in GitHub Desktop.
Save sameernyaupane/7cc8faaa3b9e33bcbb4fe313cda73a65 to your computer and use it in GitHub Desktop.
<?php
namespace Tests\Unit;
use App\Calculate;
use PHPUnit\Framework\TestCase;
class CalculateTest extends TestCase
{
public function setUp()
{
$this->calculate = new Calculate();
}
public function test_areaOfSquare_WhenCalledWithLength2_Return4()
{
$length = 2;
$response = $this->calculate->areaOfSquare($length);
$this->assertTrue(is_int($response));
$this->assertEquals(4, $response);
}
}
@tim-andes
Copy link

Error with current version. I forked and added : void to the setUp function. I'll do this on any gists missing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment