| @@ 33-44 (lines=12) @@ | ||
| 30 | $this->faker = Factory::create('Fr_fr'); |
|
| 31 | } |
|
| 32 | ||
| 33 | public function testDependencyHeavenExercise() |
|
| 34 | { |
|
| 35 | $e = new DependencyHeaven($this->faker); |
|
| 36 | $this->assertEquals('Dependency Heaven', $e->getName()); |
|
| 37 | $this->assertEquals('An introduction to Composer dependency management', $e->getDescription()); |
|
| 38 | $this->assertEquals(ExerciseType::CGI, $e->getType()); |
|
| 39 | ||
| 40 | $this->assertInstanceOf(SolutionInterface::class, $e->getSolution()); |
|
| 41 | $this->assertFileExists(realpath($e->getSolution()->getEntryPoint())); |
|
| 42 | $this->assertFileExists(realpath($e->getProblem())); |
|
| 43 | $this->assertNull($e->tearDown()); |
|
| 44 | } |
|
| 45 | ||
| 46 | public function testGetRequiredPackages() |
|
| 47 | { |
|
| @@ 18-30 (lines=13) @@ | ||
| 15 | */ |
|
| 16 | class HelloWorldTest extends PHPUnit_Framework_TestCase |
|
| 17 | { |
|
| 18 | public function testHelloWorldExercise() |
|
| 19 | { |
|
| 20 | $e = new HelloWorld; |
|
| 21 | $this->assertEquals('Hello World', $e->getName()); |
|
| 22 | $this->assertEquals('Simple Hello World exercise', $e->getDescription()); |
|
| 23 | $this->assertEquals(ExerciseType::CLI, $e->getType()); |
|
| 24 | ||
| 25 | $this->assertEquals([], $e->getArgs()); |
|
| 26 | ||
| 27 | $this->assertInstanceOf(SolutionInterface::class, $e->getSolution()); |
|
| 28 | $this->assertFileExists(realpath($e->getProblem())); |
|
| 29 | $this->assertNull($e->tearDown()); |
|
| 30 | } |
|
| 31 | } |
|
| 32 | ||