Skip to content

Commit

Permalink
fix namespace for phpunit testCase and (expectException)
Browse files Browse the repository at this point in the history
  • Loading branch information
ottosmops committed Jul 24, 2019
1 parent b53daed commit bf1dfcb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions .phpunit.result.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
C:37:"PHPUnit\Runner\DefaultTestResultCache":1142:{a:2:{s:7:"defects";a:3:{s:92:"Ottosmops\Pdftotext\Test\PdftotextTest::it_will_throw_an_exception_when_the_pdf_is_not_found";i:4;s:95:"Ottosmops\Pdftotext\Test\PdftotextTest::it_will_throw_an_exception_when_the_binary_is_not_found";i:4;s:93:"Ottosmops\Pdftotext\Test\PdftotextTest::it_will_throw_an_exception_when_the_pdf_is_not_valide";i:4;}s:5:"times";a:8:{s:70:"Ottosmops\Pdftotext\Test\PdftotextTest::it_can_extract_text_from_a_pdf";d:0.032;s:83:"Ottosmops\Pdftotext\Test\PdftotextTest::it_provides_a_static_method_to_extract_text";d:0.022;s:96:"Ottosmops\Pdftotext\Test\PdftotextTest::it_provides_a_static_method_to_extract_text_with_options";d:0.025;s:56:"Ottosmops\Pdftotext\Test\PdftotextTest::it_provides_utf8";d:0.025;s:92:"Ottosmops\Pdftotext\Test\PdftotextTest::it_will_throw_an_exception_when_the_pdf_is_not_found";d:0.012;s:70:"Ottosmops\Pdftotext\Test\PdftotextTest::it_can_hande_paths_with_spaces";d:0.024;s:95:"Ottosmops\Pdftotext\Test\PdftotextTest::it_will_throw_an_exception_when_the_binary_is_not_found";d:0.009;s:93:"Ottosmops\Pdftotext\Test\PdftotextTest::it_will_throw_an_exception_when_the_pdf_is_not_valide";d:0.02;}}}
11 changes: 5 additions & 6 deletions tests/PdftotextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
use Ottosmops\Pdftotext\Exceptions\CouldNotExtractText;
use Ottosmops\Pdftotext\Exceptions\FileNotFound;
use Ottosmops\Pdftotext\Exceptions\BinaryNotFound;
use PHPUnit\Framework\TestCase;


class PdftotextTest extends \PHPUnit_Framework_TestCase
class PdftotextTest extends TestCase
{
protected $dummyPdf = __DIR__.'/testfiles/dummy.pdf';
protected $dummyPdfutf = __DIR__.'/testfiles/dummy-utf8.pdf';
Expand All @@ -21,7 +21,6 @@ public function it_can_extract_text_from_a_pdf()
->pdf($this->dummyPdf)
->text();
$this->assertSame($this->dummyPdfText, $text);

}

/** @test */
Expand All @@ -45,7 +44,7 @@ public function it_provides_utf8()
/** @test */
public function it_will_throw_an_exception_when_the_pdf_is_not_found()
{
$this->setExpectedException(FileNotFound::class);
$this->expectException(FileNotFound::class);
$text = (new Extract())
->pdf('/no/pdf/here/dummy.pdf')
->text();
Expand All @@ -61,7 +60,7 @@ public function it_can_hande_paths_with_spaces()
/** @test */
public function it_will_throw_an_exception_when_the_binary_is_not_found()
{
$this->setExpectedException(BinaryNotFound::class);
$this->expectException(BinaryNotFound::class);
(new Extract('/there/is/no/place/like/home/pdftotext'))
->pdf($this->dummyPdf)
->text();
Expand All @@ -70,7 +69,7 @@ public function it_will_throw_an_exception_when_the_binary_is_not_found()
/** @test */
public function it_will_throw_an_exception_when_the_pdf_is_not_valide()
{
$this->setExpectedException(CouldNotExtractText::class);
$this->expectException(CouldNotExtractText::class);
(new Extract())
->pdf(__DIR__.'/testfiles/corrupted_dummy.pdf')
->text();
Expand Down

0 comments on commit bf1dfcb

Please sign in to comment.