/** * Adds add callback to an asset file which already has some. */ function testAssetfileCallbackAddToExisting() { $this->testAssetfileCallbackLoadFile(); $assetFile = 'test/somehashhere/index.xml'; $asset = new binarypool_asset($this->getDummyStorage(), $assetFile); $this->assertEqual(2, count($asset->getCallbacks())); $asset->addCallback('http://testing_this.local.ch/falsetest'); $this->assertEqual(3, count($asset->getCallbacks())); // Save $xml = $asset->getXML(); file_put_contents(binarypool_config::getRoot() . $assetFile, $xml); // Check that callbacks are loaded again $asset = new binarypool_asset($this->getDummyStorage(), $assetFile); $this->assertEqual($asset->getCallbacks(), array('http://testing_this.local.ch/', 'http://testing_this.local.ch/2', 'http://testing_this.local.ch/falsetest')); }