Exemple #1
0
 /**
  * @test
  */
 public function append()
 {
     $collection = new Tx_Asdis_Domain_Model_Server_Collection();
     $server = new Tx_Asdis_Domain_Model_Server();
     $collection->append($server);
     $this->assertEquals(1, $collection->count());
 }
 /**
  * @test
  */
 public function distribute()
 {
     $assets = new Tx_Asdis_Domain_Model_Asset_Collection();
     $asset1 = new Tx_Asdis_Domain_Model_Asset();
     $asset2 = new Tx_Asdis_Domain_Model_Asset();
     $asset3 = new Tx_Asdis_Domain_Model_Asset();
     $asset1->setOriginalPath('/typo3temp/1.gif');
     $asset2->setOriginalPath('/typo3temp/2.gif');
     $asset3->setOriginalPath('/typo3temp/3.gif');
     $assets->append($asset1);
     $assets->append($asset2);
     $assets->append($asset3);
     $servers = new Tx_Asdis_Domain_Model_Server_Collection();
     $server1 = new Tx_Asdis_Domain_Model_Server();
     $server2 = new Tx_Asdis_Domain_Model_Server();
     $servers->append($server1);
     $servers->append($server2);
     $this->algorithm->distribute($assets, $servers);
     $this->assertEquals('Tx_Asdis_Domain_Model_Server', get_class($asset1->getServer()));
     $this->assertEquals('Tx_Asdis_Domain_Model_Server', get_class($asset2->getServer()));
     $this->assertEquals('Tx_Asdis_Domain_Model_Server', get_class($asset3->getServer()));
 }