init: Erste Version aus Test-App erstellen

This commit is contained in:
2022-04-27 13:16:21 +02:00
commit 0cb06e2150
7 changed files with 195 additions and 0 deletions
+48
View File
@@ -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);
}
}