-
Notifications
You must be signed in to change notification settings - Fork 0
/
PrototypeTest.php
28 lines (17 loc) · 909 Bytes
/
PrototypeTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
require_once __DIR__ . '/../vendor/autoload.php';
use PHPUnit\Framework\TestCase;
class PrototypeTest extends TestCase
{
public function test_prototype() : void
{
$ninja = new PrototypePattern\App\Ninja('Naruto', 100, ['rasengan', 'kage bunshin'], false, false);
$ninjaFactory = new PrototypePattern\App\Factories\NinjaFactory($ninja);
$this->assertEquals($ninjaFactory->emptySlateNinja()->chakra, 0);
$this->assertEquals($ninjaFactory->emptySlateNinja()->techniques, []);
$this->assertEquals($ninjaFactory->ninjaWithChakra()->chakra, 100);
$this->assertEquals($ninjaFactory->ninjaWithChakra()->techniques, []);
$this->assertEquals($ninjaFactory->ninjaWithChakraAndTechniques()->chakra, 100);
$this->assertEquals($ninjaFactory->ninjaWithChakraAndTechniques()->techniques, ['rasengan', 'kage bunshin']);
}
}