Tests/DocumentResolver/Type/PdfTest.php
/**
     * @test
     * @expectedException \Simgroep\ConcurrentSpiderBundle\InvalidContentException
     * @expectedExceptionMessage PDF didn't contain enough content (minimal chars is 3)
     */
@test
@expectedException \Simgroep\ConcurrentSpiderBundle\InvalidContentException
@expectedExceptionMessage PDF didn't contain enough content (minimal chars is 3)
@test @expectedException \ Simgroep \ ConcurrentSpiderBundle \ InvalidContentException @expectedExceptionMessage PDF didn ' t contain enough content ( minimal chars is 3 )
public function throwExceptionOnLessThenMinimalContentLength()
    {
        $resource = $this->getMockBuilder('VDB\Spider\Resource')
            ->disableOriginalConstructor()
            ->setMethods(['getResponse'])
            ->getMock();
        $type = $this->getMockBuilder('Simgroep\ConcurrentSpiderBundle\DocumentResolver\Type\Pdf')
            ->setConstructorArgs(['/usr/local/sbin/pdftotext'])
            ->setMethods(['extractContentFromResource'])
            ->getMock();
        $type->expects($this->once())
            ->method('extractContentFromResource')
            ->with($resource)
            ->will($this->returnValue('te'));
        $type->getData($resource);
    }
public function throwExceptionOnLessThenMinimalContentLength ( ) { $ resource = $ this -> getMockBuilder ( 'VDB\Spider\Resource' ) -> disableOriginalConstructor ( ) -> setMethods ( [ 'getResponse' ] ) -> getMock ( ) ; $ type = $ this -> getMockBuilder ( 'Simgroep\ConcurrentSpiderBundle\DocumentResolver\Type\Pdf' ) -> setConstructorArgs ( [ '/usr/local/sbin/pdftotext' ] ) -> setMethods ( [ 'extractContentFromResource' ] ) -> getMock ( ) ; $ type -> expects ( $ this -> once ( ) ) -> method ( 'extractContentFromResource' ) -> with ( $ resource ) -> will ( $ this -> returnValue ( 'te' ) ) ; $ type -> getData ( $ resource ) ; }
@test
 @expectedException \Simgroep\ConcurrentSpiderBundle\InvalidContentException
 @expectedExceptionMessage PDF didn't contain enough content (minimal chars is 3)
@test @expectedException \ Simgroep \ ConcurrentSpiderBundle \ InvalidContentException @expectedExceptionMessage PDF didn ' t contain enough content ( minimal chars is 3 )
//exception is thrown there !