init: Erste Version aus Test-App erstellen
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace TorstenHettstedt\XmlReader\Sax\Tests\Unit;
|
||||
|
||||
use Codeception\Stub\Expected;
|
||||
use Codeception\Test\Unit;
|
||||
use Exception;
|
||||
use TorstenHettstedt\XmlReader\Sax\XmlReaderInterfaces;
|
||||
use TorstenHettstedt\XmlReader\Sax\XmlSaxParser;
|
||||
|
||||
class XmlSaxParserTest extends Unit
|
||||
{
|
||||
|
||||
const XML_DATA = <<<XML
|
||||
<?xml version = "1.0" encoding = "utf-8"?>
|
||||
<tutors>
|
||||
<course>
|
||||
<name>Android</name>
|
||||
<email>contact@tutorialspoint.com</email>
|
||||
</course>
|
||||
|
||||
<course>
|
||||
<name>Java</name>
|
||||
</course>
|
||||
</tutors>
|
||||
XML;
|
||||
|
||||
protected $xmlReader = null;
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->xmlReader = $this->makeEmpty(XmlReaderInterfaces::class, [
|
||||
'tag_open' => Expected::exactly(6),
|
||||
'cdata' => Expected::exactly(3),
|
||||
'tag_close' => Expected::exactly(6),
|
||||
]);
|
||||
}
|
||||
|
||||
public function testParse()
|
||||
{
|
||||
$reader = new XmlSaxParser($this->xmlReader);
|
||||
$reader->parse(self::XML_DATA);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user