Exemple #1
0
 /**
  * @dataProvider getShortUrlVariations
  */
 public function testCanInsertAndGetParametersForAShortUrl($shortUrlId, array $query = array(), $extension = null)
 {
     $publicKey = 'publickey';
     $imageIdentifier = 'id';
     $this->assertTrue($this->adapter->insertShortUrl($shortUrlId, $publicKey, $imageIdentifier, $extension, $query));
     $params = $this->adapter->getShortUrlParams($shortUrlId);
     $this->assertSame($publicKey, $params['publicKey']);
     $this->assertSame($imageIdentifier, $params['imageIdentifier']);
     $this->assertSame($extension, $params['extension']);
     $this->assertSame($query, $params['query']);
     $this->assertSame($shortUrlId, $this->adapter->getShortUrlId($publicKey, $imageIdentifier, $extension, $query));
 }
Exemple #2
0
 public function testCanGetShortUrlIdThatDoesNotExist()
 {
     $this->assertNull($this->adapter->getShortUrlId('user', 'image'));
 }