Skip to content

Commit

Permalink
Improve Writer unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
webeweb committed Apr 14, 2020
1 parent 95364a1 commit dce2c60
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/IO/WriterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

namespace WBW\Library\XMLTV\Tests\IO;

use Psr\Log\LoggerInterface;
use WBW\Library\XMLTV\IO\Reader;
use WBW\Library\XMLTV\IO\Writer;
use WBW\Library\XMLTV\Tests\AbstractTestCase;
Expand Down Expand Up @@ -51,10 +52,13 @@ protected function setUp() {
*/
public function testWriteXml() {

// Set a Logger mock.
$logger = $this->getMockBuilder(LoggerInterface::class)->getMock();

// Set a Tv mock.
$tv = Reader::readXml($this->filename);

Writer::writeXml($tv, $this->output);
Writer::writeXml($tv, $this->output, $logger);
$this->assertFileExists($this->output);

$this->assertEquals(preg_replace("/\ {4}/", " ", file_get_contents($this->filename)), file_get_contents($this->output));
Expand Down

0 comments on commit dce2c60

Please sign in to comment.