@@ 15-30 (lines=16) @@ | ||
12 | * Class MakeConstantYourArraysTest |
|
13 | * @package PhpSchool\Php7WayTest\Exercise |
|
14 | */ |
|
15 | class MakeConstantYourArraysTest extends PHPUnit_Framework_TestCase |
|
16 | { |
|
17 | public function testMakeConstantYourArraysExercise() |
|
18 | { |
|
19 | $e = new MakeConstantYourArrays(); |
|
20 | $this->assertEquals('Make constant your arrays', $e->getName()); |
|
21 | $this->assertEquals('Define an array as constant', $e->getDescription()); |
|
22 | $this->assertEquals(ExerciseType::CLI, $e->getType()); |
|
23 | ||
24 | $this->assertEquals(['A', 'B', 'C'], $e->getArgs()); |
|
25 | ||
26 | $this->assertInstanceOf(SolutionInterface::class, $e->getSolution()); |
|
27 | $this->assertFileExists(realpath($e->getProblem())); |
|
28 | $this->assertNull($e->tearDown()); |
|
29 | } |
|
30 | } |
|
31 |
@@ 15-30 (lines=16) @@ | ||
12 | * Class NewGenerationBackTest |
|
13 | * @package PhpSchool\Php7WayTest\Exercise |
|
14 | */ |
|
15 | class NewGenerationBackTest extends PHPUnit_Framework_TestCase |
|
16 | { |
|
17 | public function testNewGenerationBackExercise() |
|
18 | { |
|
19 | $e = new NewGenerationBack(); |
|
20 | $this->assertEquals('The new generation is back', $e->getName()); |
|
21 | $this->assertEquals('Use generators returning a value', $e->getDescription()); |
|
22 | $this->assertEquals(ExerciseType::CLI, $e->getType()); |
|
23 | ||
24 | $this->assertEquals([1, 2, 3], $e->getArgs()); |
|
25 | ||
26 | $this->assertInstanceOf(SolutionInterface::class, $e->getSolution()); |
|
27 | $this->assertFileExists(realpath($e->getProblem())); |
|
28 | $this->assertNull($e->tearDown()); |
|
29 | } |
|
30 | } |
|
31 |
@@ 15-30 (lines=16) @@ | ||
12 | * Class NullItsNotTest |
|
13 | * @package PhpSchool\Php7WayTest\Exercise |
|
14 | */ |
|
15 | class NullItsNotTest extends PHPUnit_Framework_TestCase |
|
16 | { |
|
17 | public function testNullItsNotExercice() |
|
18 | { |
|
19 | $e = new NullItsNot(); |
|
20 | $this->assertEquals('Null, it\'s not!', $e->getName()); |
|
21 | $this->assertEquals('Use the null coalescing operator to check if the value exists', $e->getDescription()); |
|
22 | $this->assertEquals(ExerciseType::CLI, $e->getType()); |
|
23 | ||
24 | $this->assertEquals(["FirstArgument"], $e->getArgs()); |
|
25 | ||
26 | $this->assertInstanceOf(SolutionInterface::class, $e->getSolution()); |
|
27 | $this->assertFileExists(realpath($e->getProblem())); |
|
28 | $this->assertNull($e->tearDown()); |
|
29 | } |
|
30 | } |
|
31 |
@@ 15-30 (lines=16) @@ | ||
12 | * Class NullItsNullTest |
|
13 | * @package PhpSchool\Php7WayTest\Exercise |
|
14 | */ |
|
15 | class NullItsNullTest extends PHPUnit_Framework_TestCase |
|
16 | { |
|
17 | public function testNullItsNullExercice() |
|
18 | { |
|
19 | $e = new NullItsNull(); |
|
20 | $this->assertEquals('Null, it\'s null!', $e->getName()); |
|
21 | $this->assertEquals('Use the null coalescing operator to check if the value is null', $e->getDescription()); |
|
22 | $this->assertEquals(ExerciseType::CLI, $e->getType()); |
|
23 | ||
24 | $this->assertEquals(["FirstArgument", "SecondArgument"], $e->getArgs()); |
|
25 | ||
26 | $this->assertInstanceOf(SolutionInterface::class, $e->getSolution()); |
|
27 | $this->assertFileExists(realpath($e->getProblem())); |
|
28 | $this->assertNull($e->tearDown()); |
|
29 | } |
|
30 | } |
|
31 |