Example #1
0
 public function testFilterDumpException()
 {
     $asset = $this->createAssetMock();
     $exception = new \Exception('expected message', 1234);
     $this->cssRewriter->expects($this->once())->method('rewrite')->with($this->identicalTo($reference = $this->createReference()), $this->identicalTo($asset))->will($this->throwException($exception));
     $asset->expects($this->once())->method('getContent')->will($this->returnValue($reference[0]));
     try {
         $this->cssRewriteFilter->filterDump($asset);
         $this->fail();
     } catch (FilterException $e) {
         $this->assertSame($e->getMessage(), $exception->getMessage());
         $this->assertSame($e->getCode(), $exception->getCode());
         $this->assertSame($e->getPrevious(), $exception);
     }
 }