Imbo\EventListener\ImageVariations\Storage\StorageInterface::storeImageVariation PHP Method

storeImageVariation() public method

Store an image variation
public storeImageVariation ( string $user, string $imageIdentifier, string $blob, integer $width ) : boolean
$user string The user which the image belongs to
$imageIdentifier string The image identifier of the original
$blob string The image blob to store
$width integer The width of the variation
return boolean
    function storeImageVariation($user, $imageIdentifier, $blob, $width);

Usage Example

Beispiel #1
0
 public function testCanDeleteOneOrMoreImageVariations()
 {
     $key = 'key';
     $id = 'imageId';
     $blob = file_get_contents(FIXTURES_DIR . '/colors.png');
     $this->assertTrue($this->adapter->storeImageVariation($key, $id, $blob, 100));
     $this->assertTrue($this->adapter->storeImageVariation($key, $id, 'blob2', 200));
     $this->assertTrue($this->adapter->storeImageVariation($key, $id, 'blob3', 300));
     $this->assertSame($blob, $this->adapter->getImageVariation($key, $id, 100));
     $this->assertSame('blob2', $this->adapter->getImageVariation($key, $id, 200));
     $this->assertSame('blob3', $this->adapter->getImageVariation($key, $id, 300));
     $this->assertTrue($this->adapter->deleteImageVariations($key, $id, 100));
     $this->assertNull($this->adapter->getImageVariation($key, $id, 100));
     $this->assertSame('blob2', $this->adapter->getImageVariation($key, $id, 200));
     $this->assertSame('blob3', $this->adapter->getImageVariation($key, $id, 300));
     $this->assertTrue($this->adapter->deleteImageVariations($key, $id));
     $this->assertNull($this->adapter->getImageVariation($key, $id, 200));
     $this->assertNull($this->adapter->getImageVariation($key, $id, 300));
 }
All Usage Examples Of Imbo\EventListener\ImageVariations\Storage\StorageInterface::storeImageVariation