/** * @expectedException \RuntimeException * @expectedExceptionMessage No search criteria specified */ public function testFailIfNoCriteria() { $args = self::$findCommand->parseArgs(new StringArgs('')); $this->repo->expects($this->never())->method('find'); $this->discovery->expects($this->never())->method('findByType'); $this->handler->handle($args, $this->io); }
/** * @expectedException \Puli\AssetPlugin\Api\UrlGenerator\CannotGenerateUrlException * @expectedExceptionMessage foobar */ public function testFailIfTargetNotFound() { $binding = new EagerBinding('/path{,/**/*}', $this->resources, $this->bindingType, array(AssetPlugin::TARGET_PARAMETER => 'foobar', AssetPlugin::PATH_PARAMETER => '/css')); $this->discovery->expects($this->once())->method('findByPath')->with('/path/path/style.css', AssetPlugin::BINDING_TYPE)->willReturn(array($binding)); $this->generator->generateUrl('/path/path/style.css'); }