Пример #1
0
 /**
  *
  * @return void
  */
 public function testTagsAndBundles()
 {
     // get tags
     $tags = $this->_delicious->getTags();
     $this->assertType('array', $tags);
     $tags = array_keys($tags);
     if (count($tags) < 1) {
         $this->fail('Test account corrupted - no tags');
     }
     $oldTagName = $tags[0];
     $newTagName = uniqid('tag');
     // rename tag
     $this->_delicious->renameTag($oldTagName, $newTagName);
     sleep(15);
     // get renamed tags
     $tags = $this->_delicious->getTags();
     $this->assertArrayHasKey($newTagName, $tags);
     $this->assertArrayNotHasKey($oldTagName, $tags);
     $tags = array_keys($tags);
     // add new bundle
     $newBundleName = uniqid('bundle');
     $this->_delicious->addBundle($newBundleName, $tags);
     sleep(15);
     // check if bundle was added
     $bundles = $this->_delicious->getBundles();
     $this->assertType('array', $bundles);
     $this->assertArrayHasKey($newBundleName, $bundles);
     $this->assertEquals($tags, $bundles[$newBundleName]);
     // delete bundle
     $this->_delicious->deleteBundle($newBundleName);
     sleep(15);
     // check if bundle was deleted
     $bundles = $this->_delicious->getBundles();
     $this->assertArrayNotHasKey($newBundleName, $bundles);
 }