blob: 1cf56f0fefba1a465b13fa0e15ed8bb97d03b488 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
<?php
namespace League\Glide\Urls;
class UrlBuilderFactoryTest extends \PHPUnit_Framework_TestCase
{
public function testCreate()
{
$urlBuilder = UrlBuilderFactory::create('/img');
$this->assertInstanceOf('League\Glide\Urls\UrlBuilder', $urlBuilder);
$this->assertEquals('/img/image.jpg', $urlBuilder->getUrl('image.jpg'));
}
public function testCreateWithSignKey()
{
$urlBuilder = UrlBuilderFactory::create('img', 'example-sign-key');
$this->assertEquals(
'/img/image.jpg?s=56020c3dc5f68487c14510343c3e2c43',
$urlBuilder->getUrl('image.jpg')
);
}
public function testCreateWithSignKeyWithLeadingSlash()
{
$urlBuilder = UrlBuilderFactory::create('/img', 'example-sign-key');
$this->assertEquals(
'/img/image.jpg?s=56020c3dc5f68487c14510343c3e2c43',
$urlBuilder->getUrl('image.jpg')
);
}
}
|