Skip to content

Commit

Permalink
Use new PHP features (::class, null coalescing)
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Jul 9, 2017
1 parent c48479b commit 1d581e6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Tests/Wrapper/DompdfWrapperTest.php
Expand Up @@ -12,6 +12,7 @@
use Core23\DompdfBundle\Wrapper\DompdfWrapper;
use Dompdf\Dompdf;
use PHPUnit\Framework\TestCase;
use Dompdf\Options;

class DompdfWrapperTest extends TestCase
{
Expand All @@ -30,9 +31,9 @@ class DompdfWrapperTest extends TestCase
*/
protected function setUp()
{
$this->dompdf = $this->createMock('Dompdf\Dompdf');
$this->dompdf = $this->createMock(Dompdf::class);

$this->dompdfWrapper = $this->getMockBuilder('Core23\DompdfBundle\Wrapper\DompdfWrapper')
$this->dompdfWrapper = $this->getMockBuilder(DompdfWrapper::class)
->setConstructorArgs(array('web_prefix/', array('dpi' => '200')))
->setMethods(array('createDompdf'))
->getMock();
Expand All @@ -50,7 +51,7 @@ public function testCreateOptions()
{
$options = $this->dompdfWrapper->createOptions(array('tempDir' => 'foo'));

$this->assertInstanceOf('Dompdf\Options', $options);
$this->assertInstanceOf(Options::class, $options);
$this->assertSame('foo', $options->getTempDir());
$this->assertSame('200', $options->getDpi());
}
Expand Down Expand Up @@ -97,7 +98,7 @@ public function testStreamHtmlWithImg()
->method('createDompdf')
->will($this->returnValue($this->dompdf));

$this->dompdfWrapper->streamHtml($input, 'file.pdf', array('tempDir' => 'bar'), true);
$this->dompdfWrapper->streamHtml($input, 'file.pdf', array('tempDir' => 'bar'));
}

public function testGetPdf()
Expand Down Expand Up @@ -140,6 +141,6 @@ public function testGetPdfWithImg()
->method('createDompdf')
->will($this->returnValue($this->dompdf));

$this->dompdfWrapper->getPdf($input, array('tempDir' => 'bar'), true);
$this->dompdfWrapper->getPdf($input, array('tempDir' => 'bar'));
}
}

0 comments on commit 1d581e6

Please sign in to comment.