Source of file ExtensionSnapshotTest.php
Size: 0,909 Bytes - Last Modified: 2021-12-23T10:57:05+00:00
/var/www/docs.ssmods.com/process/src/tests/control/ExtensionSnapshotTest.php
123456789101112131415161718192021222324252627282930313233 | <?php /** * @package extensionmanager * @subpackage tests */ class ExtensionSnapshotTest extends SapphireTest { public static $fixture_file = 'extensionmanager/tests/ExtensionManagerTest.yml'; public function testSaveSnapshot() { $obj = $this->objFromFixture('ExtensionData', 'testmodule'); $realUrl = 'http://openbees.org/images/Demo.jpg'; $imageId = ExtensionSnapshot::save_snapshot($realUrl, $obj->Name); $image = Image::get()->byID($imageId); $this->assertFileExists(BASE_PATH.DIRECTORY_SEPARATOR.$image->Filename); } /** * @expectedException InvalidArgumentException */ public function testSaveSnapshotException() { $obj = $this->objFromFixture('ExtensionData', 'testmodule'); $fakeUrl = 'http://openbees.org/images/FakeImage.jpg'; ExtensionSnapshot::save_snapshot($fakeUrl, $obj->Name); } } |