public function testParseableCodeReturnsSuccess()
 {
     file_put_contents($this->file, '<?php $lol = "lol";');
     $result = $this->check->check($this->createMock(ExerciseInterface::class), new Input('app', ['program' => $this->file]));
     $this->assertInstanceOf(Success::class, $result);
     $this->assertEquals('Code Parse Check', $result->getCheckName());
 }
 public function testWhenBeforeChecksFailTheyReturnImmediately()
 {
     $this->createExercise();
     $this->check->expects($this->once())->method('check')->will($this->returnValue(new Failure('Failure', 'nope')));
     $doNotRunMe = $this->getMock(SimpleCheckInterface::class, [], [], 'DoNotRunMeCheck');
     $doNotRunMe->expects($this->never())->method('check');
     $this->check->expects($this->once())->method('canRun')->with($this->exerciseType)->will($this->returnValue(true));
     $this->check->expects($this->once())->method('getExerciseInterface')->will($this->returnValue(ExerciseInterface::class));
     $doNotRunMe->expects($this->once())->method('canRun')->with($this->exerciseType)->will($this->returnValue(true));
     $doNotRunMe->expects($this->once())->method('getExerciseInterface')->will($this->returnValue(ExerciseInterface::class));
     $this->checkRepository->registerCheck($doNotRunMe);
     $this->exerciseDispatcher->requireCheck(get_class($this->check), ExerciseDispatcher::CHECK_BEFORE);
     $this->exerciseDispatcher->requireCheck(get_class($doNotRunMe), ExerciseDispatcher::CHECK_BEFORE);
     $result = $this->exerciseDispatcher->verify($this->exercise, $this->file);
     $this->assertInstanceOf(ResultAggregator::class, $result);
     $this->assertFalse($result->isSuccessful());
 }