public function testShouldBeAbleToGetDirectoryViaHTMLFragment()
 {
     $directory = \Stormpath\Resource\Directory::create(array('name' => makeUniqueName('DirectoryTest htmlFragment')));
     $href = $directory->href;
     $hrefParts = array_reverse(explode('/', $href));
     $dir = \Stormpath\Resource\Directory::get($hrefParts[0]);
     $this->assertInstanceOf('\\Stormpath\\Resource\\Directory', $dir);
     $this->assertEquals($href, $dir->href);
     $dir2 = \Stormpath\Client::get($hrefParts[1] . '/' . $hrefParts[0], Stormpath::DIRECTORY);
     $this->assertInstanceOf('\\Stormpath\\Resource\\Directory', $dir2);
     $this->assertEquals($href, $dir2->href);
     $directory->delete();
 }
Пример #2
0
 /**
  * @expectedException \Stormpath\Resource\ResourceError
  */
 public function testDelete()
 {
     $directory = \Stormpath\Resource\Directory::create(array('name' => 'Another random directory' . md5(time())));
     $this->assertInstanceOf('\\Stormpath\\Resource\\Directory', $directory);
     $this->assertContains('Another random directory', $directory->name);
     $href = $directory->href;
     $directory->delete();
     \Stormpath\Resource\Directory::get($href);
 }