/** * Through the database fixture, * all school dates are loaded from an ics file in DataFixtures\Files */ public static function setUpBeforeClass() { self::$fixture = new GestyFixturesWebTestCase(); self::$fixture->loadGestyFixtures(); static::bootKernel(); self::$gestyScheduler = new GestyScheduler(static::$kernel->getContainer()->get('doctrine')); }
/** * @dataProvider provideAuthenticatedUrls * @coversNothing * * @param $login * @param $password * @param $url * @param $expectedText */ public function testEmployeeAuthenticatedUrl($url, $data) { $urlBefore = $url; $url = str_replace('[id_school_ecureuil]', self::$fixture->getEntityId('school-ecureuils'), $url); $url = str_replace('[id_school_notredame]', self::$fixture->getEntityId('school-nddf'), $url); $url = str_replace('[id_school_roland]', self::$fixture->getEntityId('school-rg'), $url); foreach ($data as $expected) { $codeStatus = $expected[0]; $login = $expected[1]['login']; $password = $expected[1]['passwd']; self::$client = static::createClient(array(), array('PHP_AUTH_USER' => $login, 'PHP_AUTH_PW' => $password)); self::$client->request('GET', $url); $this->assertEquals($codeStatus, self::$client->getResponse()->getStatusCode(), "For : " . $urlBefore . " and user : '******' - ensure status is " . $codeStatus); } }