construct() public static method

public static construct ( $server, $secret, $original )
Example #1
0
 public function testUrl()
 {
     $server = 'http://thumbor.example.com';
     $secret = 'butts';
     $original = 'http://example.com/llamas.jpg';
     $builder = BuilderFactory::construct($server, $secret)->url($original);
     $expected = Builder::construct($server, $secret, $original);
     $this->assertEquals($expected, $builder);
 }
Example #2
0
 public function testToString()
 {
     $url = (string) Builder::construct('http://thumbor.example.com', 'butts', 'http://example.com/llamas.jpg')->fitIn(320, 240)->smartCrop(true)->addFilter('brightness', 42);
     $expected = 'http://thumbor.example.com/dgzk7MVde2RUq5Hbq40FvfRdno0=/fit-in/320x240/smart/filters:brightness(42)/http://example.com/llamas.jpg';
     $this->assertEquals($expected, $url);
 }