public function testNullCacheDoesNotCache() { $origClient = parent::$client->dataStore->cache; parent::$client->tearDown(); \Stormpath\Client::$cacheManager = 'Null'; $client = \Stormpath\Client::getInstance(); $cache = $client->cacheManager->getCache(); $application = \Stormpath\Resource\Application::create(array('name' => 'Another App for Null Cache ' . md5(time()))); $appInCache = $cache->get($application->href); $this->assertNull($appInCache); $application->delete(); parent::$client = $origClient; }
/** * @expectedException \Stormpath\Resource\ResourceError */ public function testDelete() { $application = \Stormpath\Resource\Application::create(array('name' => 'Yet Another App' . md5(time() . microtime() . uniqid()))); $this->assertInstanceOf('Stormpath\\Resource\\Application', $application); $this->assertContains('Yet Another App', $application->name); $href = $application->href; $application->delete(); \Stormpath\Resource\Application::get($href); }
public function testShouldBeAbleToGetApplicationViaHTMLFragment() { $application = \Stormpath\Resource\Application::create(array('name' => makeUniqueName('ApplicationTest testFragment'))); $href = $application->href; $hrefParts = array_reverse(explode('/', $href)); $app = \Stormpath\Resource\Application::get($hrefParts[0]); $this->assertInstanceOf('\\Stormpath\\Resource\\Application', $app); $this->assertEquals($href, $app->href); $app2 = \Stormpath\Client::get($hrefParts[1] . '/' . $hrefParts[0], Stormpath::APPLICATION); $this->assertInstanceOf('\\Stormpath\\Resource\\Application', $app2); $this->assertEquals($href, $app2->href); $application->delete(); }
/** * @expectedException \Stormpath\Resource\ResourceError */ public function testDelete() { $application = \Stormpath\Resource\Application::create(array('name' => makeUniqueName('ApplicationTest testDelete'))); $this->assertInstanceOf('Stormpath\\Resource\\Application', $application); $this->assertContains('testDelete', $application->name); $href = $application->href; $application->delete(); \Stormpath\Resource\Application::get($href); }
/** @test */ public function an_application_should_allow_setting_authorized_callback_uri() { $application = \Stormpath\Resource\Application::create(array('name' => makeUniqueName('ApplicationTest authorizedCallbackUri'))); $application->setAuthorizedCallbackUris(['http://myapplication.com/whatever/callback', 'http://myapplication.com/whatever/callback2']); $application->save(); $application = \Stormpath\Resource\Application::get($application->href); $this->assertCount(2, $application->authorizedCallbackUris); $application->delete(); }