Пример #1
0
 public function testSecure()
 {
     $url = new URL(['signing_key' => 'test']);
     $this->assertEquals('/path/file-200x100.png?token=dc0787d205f619a2b2df8554c960072e', $url->generate('/path/file.png', 200, 100));
     $url = new URL(['signing_key' => 'test']);
     $this->assertNotEquals('/path/file-200x100.png?token=dc0787d205f619a2b2df8554c960072e', $url->generate('/path/file.png', 200, 200));
 }
Пример #2
0
 public function testCropsInSubDirectory()
 {
     $url = new URL(['path' => 'images/(?:crops/)?(.*)$']);
     $this->assertEquals(['file.jpg', 200, 100, []], $url->parse('images/crops/file-200x100.jpg'));
 }