Example #1
0
	public function testDisplayPreview(){
		$src = new \Core\Filestore\Backends\FileLocal('core/tests/ivak_TV_Test_Screen.png');
		$dst = \Core\Filestore\Factory::File('tmp/filelocaltest-displaypreview.dat');

		// Start capturing the output
		ob_start();
		$src->displayPreview('32x32', false);
		$dat = ob_get_clean();

		$this->assertNotEmpty($dat);

		// Quickest way to verify this is an actual image... write it to another file and check that!
		$dst->putContents($dat);

		// Make sure it wrote
		$this->assertTrue($dst->exists());
		// And is a non-zero size
		$this->assertGreaterThan(0, $dst->getFilesize());
		// And is an image
		$this->assertTrue($dst->isImage());
		// Finally, clean it up.
		$this->assertTrue($dst->delete());
	}