public static function setUpBeforeClass() { $client = static::createClient(); $container = $client->getContainer(); $doTest = ConnectivityUtilities::checkConnection($container); if ($doTest[0] === false) { self::markTestSkipped($doTest[1]); } }
public static function testGetActionPersonal($main, $client) { $credentials = ConnectivityUtilities::getLoginCredentials($client->getContainer()); if ($credentials !== false) { //Now, test grabbing personal details for a title $client->request('GET', '/2/anime/189', array('mine' => 1), array(), array('PHP_AUTH_USER' => $credentials['username'], 'PHP_AUTH_PW' => $credentials['password'])); $rawContent = $client->getResponse()->getContent(); $statusCode = $client->getResponse()->getStatusCode(); $content = json_decode($rawContent); $main->assertNotNull($content); $main->assertEquals(200, $statusCode); $main->assertInternalType('int', $content->score); $main->assertEquals(7, $content->score); $main->assertEquals('completed', $content->watched_status); $main->assertEquals('2000-01-01', $content->watching_start); $main->assertEquals('2000-03-20', $content->watching_end); } else { $main->markTestSkipped('Username and password must be set.'); } }