public function setUp() { $this->check = new DatabaseCheck(); $this->exercise = $this->createMock(DatabaseExerciseInterface::class); $this->dbDir = sprintf('%s/PhpSchool_PhpWorkshop_Check_DatabaseCheck', str_replace('\\', '/', realpath(sys_get_temp_dir()))); $this->assertEquals('Database Verification Check', $this->check->getName()); $this->assertEquals(DatabaseExerciseCheck::class, $this->check->getExerciseInterface()); }
public function setUp() { $containerBuilder = new ContainerBuilder(); $containerBuilder->addDefinitions(__DIR__ . '/../../app/config.php'); $container = $containerBuilder->build(); $this->checkRepository = $container->get(CheckRepository::class); $this->check = new DatabaseCheck(); $this->exercise = $this->createMock(DatabaseExerciseInterface::class); $this->exercise->expects($this->any())->method('getType')->willReturn(ExerciseType::CLI()); $this->dbDir = sprintf('%s/PhpSchool_PhpWorkshop_Check_DatabaseCheck', str_replace('\\', '/', realpath(sys_get_temp_dir()))); $this->assertEquals('Database Verification Check', $this->check->getName()); $this->assertEquals(DatabaseExerciseCheck::class, $this->check->getExerciseInterface()); }