Example #1
0
 function it_expands_a_url(Provider $provider, PoolInterface $pool, ItemInterface $item)
 {
     $item->isMiss()->willReturn(true);
     $item->set('http://any.url')->shouldBeCalled();
     $pool->getItem(md5('http://short.ly/1234'))->willReturn($item);
     $provider->expand('http://short.ly/1234')->willReturn('http://any.url');
     $this->expand('http://short.ly/1234')->shouldReturn('http://any.url');
 }
Example #2
0
 function it_expands_a_url(Provider $provider1, Provider $provider2)
 {
     $provider1->expand('http://short.ly/1234')->willReturn('http://any.url');
     $provider2->expand('http://short.er/1234')->willReturn('http://short.ly/1234');
     $this->addProvider($provider1);
     $this->addProvider($provider2);
     $this->expand('http://short.er/1234')->shouldReturn('http://any.url');
 }
Example #3
0
 function it_expands_a_url(Provider $provider)
 {
     $provider->expand('http://goo.gl/shortened')->willReturn("http://any.url");
     $this->expand('http://goo.gl/shortened')->shouldReturn("http://any.url");
 }