diff --git a/src/main/php/xml/io/XmlStreamWriter.class.php b/src/main/php/xml/io/XmlStreamWriter.class.php index 0a6d5bea..745aa7ca 100755 --- a/src/main/php/xml/io/XmlStreamWriter.class.php +++ b/src/main/php/xml/io/XmlStreamWriter.class.php @@ -2,11 +2,10 @@ use io\streams\OutputStream; - /** * Outputs XML to an output stream. * - * @test xp://xml.unittest.io.XmlStreamWriterTest + * @test xml.unittest.io.XmlStreamWriterTest */ class XmlStreamWriter extends XmlWriter { protected $stack= []; @@ -21,6 +20,9 @@ public function __construct(OutputStream $stream) { $this->stream= $stream; } + /** @return io.streams.OutputStream */ + public function out() { return $this->stream; } + /** * Start writing a document * diff --git a/src/test/php/xml/unittest/AbstractProcessorTest.class.php b/src/test/php/xml/unittest/AbstractProcessorTest.class.php index 77ce60c1..12a69756 100755 --- a/src/test/php/xml/unittest/AbstractProcessorTest.class.php +++ b/src/test/php/xml/unittest/AbstractProcessorTest.class.php @@ -2,15 +2,10 @@ use io\FileNotFoundException; use lang\Runtime; -use unittest\{Expect, PrerequisitesNotMetError, Test, TestCase}; +use unittest\{Assert, Expect, PrerequisitesNotMetError, Test, TestCase}; use xml\{TransformerException, Tree}; -/** - * Test XSL processor - * - * @see xp://xml.IXSLProcessor - */ -abstract class AbstractProcessorTest extends TestCase { +abstract class AbstractProcessorTest { public $processor= null; public $xmlDeclaration= ''; @@ -24,7 +19,7 @@ abstract class AbstractProcessorTest extends TestCase { * @throws unittest.AssertionFailedError */ public function assertXmlEquals($expect, $actual) { - $this->assertEquals( + Assert::equals( $this->xmlDeclaration.preg_replace('#>[\s\r\n]+<#', '><', trim($expect)), preg_replace('#>[\s\r\n]+<#', '><', trim($actual)) ); @@ -82,6 +77,7 @@ public function processorCharset() { } * * @throws unittest.PrerequisitesNotMetError */ + #[Before] public function setUp() { foreach ((array)$this->neededExtension() as $ext) { if (!extension_loaded($ext)) { @@ -167,7 +163,7 @@ public function setMalformedXSLTree() { #[Test] public function paramAccessors() { $this->processor->setParam('a', 'b'); - $this->assertEquals('b', $this->processor->getParam('a')); + Assert::equals('b', $this->processor->getParam('a')); } #[Test] @@ -175,7 +171,7 @@ public function baseAccessors() { $file= Runtime::getInstance()->getExecutable()->getFilename(); $path= rtrim(realpath(dirname($file)), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; $this->processor->setBase($path); - $this->assertEquals($path, $this->processor->getBase()); + Assert::equals($path, $this->processor->getBase()); } #[Test] @@ -183,7 +179,7 @@ public function setBaseAddsTrailingDirectorySeparator() { $file= Runtime::getInstance()->getExecutable()->getFilename(); $path= rtrim(realpath(dirname($file)), DIRECTORY_SEPARATOR); $this->processor->setBase($path); - $this->assertEquals($path.DIRECTORY_SEPARATOR, $this->processor->getBase()); + Assert::equals($path.DIRECTORY_SEPARATOR, $this->processor->getBase()); } #[Test] @@ -193,9 +189,9 @@ public function setParams() { 'left' => 'one', 'right' => 'two' ]); - $this->assertEquals('b', $this->processor->getParam('a')) && - $this->assertEquals('one', $this->processor->getParam('left')) && - $this->assertEquals('two', $this->processor->getParam('right')); + Assert::equals('b', $this->processor->getParam('a')) && + Assert::equals('one', $this->processor->getParam('left')) && + Assert::equals('two', $this->processor->getParam('right')); } #[Test] @@ -207,7 +203,7 @@ public function transformationWithEmptyResult() { '); $this->processor->run(); - $this->assertEquals('', $this->processor->output()); + Assert::equals('', $this->processor->output()); } #[Test] @@ -222,8 +218,8 @@ public function iso88591XslWithoutOutputEncoding() { '); $this->processor->run(); - $this->assertEquals($this->processorCharset(), $this->processor->outputEncoding()); - $this->assertEquals('übercoder', $this->processor->output()); + Assert::equals($this->processorCharset(), $this->processor->outputEncoding()); + Assert::equals('übercoder', $this->processor->output()); } #[Test] @@ -238,8 +234,8 @@ public function iso88591XslWithUtf8OutputEncoding() { '); $this->processor->run(); - $this->assertEquals('utf-8', $this->processor->outputEncoding()); - $this->assertEquals('übercoder', $this->processor->output()); + Assert::equals('utf-8', $this->processor->outputEncoding()); + Assert::equals('übercoder', $this->processor->output()); } #[Test] @@ -254,8 +250,8 @@ public function utf8XslWithoutOutputEncoding() { '); $this->processor->run(); - $this->assertEquals($this->processorCharset(), $this->processor->outputEncoding()); - $this->assertEquals('übercoder', $this->processor->output()); + Assert::equals($this->processorCharset(), $this->processor->outputEncoding()); + Assert::equals('übercoder', $this->processor->output()); } #[Test] @@ -270,8 +266,8 @@ public function utf8XslWithUtf8OutputEncoding() { '); $this->processor->run(); - $this->assertEquals('utf-8', $this->processor->outputEncoding()); - $this->assertEquals('übercoder', $this->processor->output()); + Assert::equals('utf-8', $this->processor->outputEncoding()); + Assert::equals('übercoder', $this->processor->output()); } #[Test] @@ -286,8 +282,8 @@ public function utf8XslWithIso88591OutputEncoding() { '); $this->processor->run(); - $this->assertEquals('iso-8859-1', $this->processor->outputEncoding()); - $this->assertEquals("\xfcbercoder", $this->processor->output()); + Assert::equals('iso-8859-1', $this->processor->outputEncoding()); + Assert::equals("\xfcbercoder", $this->processor->output()); } #[Test] @@ -302,8 +298,8 @@ public function iso88591XslWithIso88591OutputEncoding() { '); $this->processor->run(); - $this->assertEquals('iso-8859-1', $this->processor->outputEncoding()); - $this->assertEquals("\xfcbercoder", $this->processor->output()); + Assert::equals('iso-8859-1', $this->processor->outputEncoding()); + Assert::equals("\xfcbercoder", $this->processor->output()); } #[Test] @@ -333,7 +329,7 @@ public function transformationToHtml() { '); $this->processor->run(); - $this->assertEquals('Hello', trim($this->processor->output())); + Assert::equals('Hello', trim($this->processor->output())); } #[Test] @@ -348,7 +344,7 @@ public function javaScriptInCDataSection() { '); $this->processor->run(); - $this->assertEquals( + Assert::equals( '', trim($this->processor->output()) ); @@ -366,7 +362,7 @@ public function omitXmlDeclaration() { '); $this->processor->run(); - $this->assertEquals('No XML declaration', trim($this->processor->output())); + Assert::equals('No XML declaration', trim($this->processor->output())); } #[Test] @@ -481,7 +477,7 @@ public function includingAFile() { '); $this->processor->run(); - $this->assertEquals('TEST', $this->processor->output()); + Assert::equals('TEST', $this->processor->output()); } #[Test] @@ -496,7 +492,7 @@ public function importingAFile() { '); $this->processor->run(); - $this->assertEquals('TEST', $this->processor->output()); + Assert::equals('TEST', $this->processor->output()); } #[Test] @@ -508,7 +504,7 @@ public function outputEncodingFromIncludedFile() { '); $this->processor->run(); - $this->assertEquals('iso-8859-1', $this->processor->outputEncoding()); + Assert::equals('iso-8859-1', $this->processor->outputEncoding()); } #[Test] @@ -520,7 +516,7 @@ public function outputEncodingFromImportedFile() { '); $this->processor->run(); - $this->assertEquals('iso-8859-1', $this->processor->outputEncoding()); + Assert::equals('iso-8859-1', $this->processor->outputEncoding()); } #[Test] @@ -532,7 +528,7 @@ public function outputEncodingFromIncludedInImportedFile() { '); $this->processor->run(); - $this->assertEquals('iso-8859-1', $this->processor->outputEncoding()); + Assert::equals('iso-8859-1', $this->processor->outputEncoding()); } #[Test] @@ -544,6 +540,6 @@ public function outputEncodingFromIncludedInIncludedFile() { '); $this->processor->run(); - $this->assertEquals('iso-8859-1', $this->processor->outputEncoding()); + Assert::equals('iso-8859-1', $this->processor->outputEncoding()); } } \ No newline at end of file diff --git a/src/test/php/xml/unittest/AbstractXMLParserTest.class.php b/src/test/php/xml/unittest/AbstractXMLParserTest.class.php index 79617236..17a6be3a 100755 --- a/src/test/php/xml/unittest/AbstractXMLParserTest.class.php +++ b/src/test/php/xml/unittest/AbstractXMLParserTest.class.php @@ -1,16 +1,11 @@ parser= new XMLParser(); } @@ -27,6 +23,7 @@ public function setUp() { /** * Tears down test case */ + #[After] public function tearDown() { unset($this->parser); } @@ -92,7 +89,7 @@ public function onFinish($instance) { #[Test] public function withoutDeclaration() { - $this->assertTrue($this->parser->parse($this->source('', true))); + Assert::true($this->parser->parse($this->source('', true))); } #[Test, Expect(XMLFormatException::class)] @@ -102,7 +99,7 @@ public function emptyString() { #[Test] public function withDeclaration() { - $this->assertTrue($this->parser->parse($this->source(''))); + Assert::true($this->parser->parse($this->source(''))); } #[Test] @@ -118,34 +115,34 @@ public function tree() { ')); - $this->assertEquals('book', $callback->tree[self::NAME]); - $this->assertEquals([], $callback->tree[self::ATTR]); + Assert::equals('book', $callback->tree[self::NAME]); + Assert::equals([], $callback->tree[self::ATTR]); with ($author= $callback->tree[self::CHLD][1]); { - $this->assertEquals('author', $author[self::NAME]); - $this->assertEquals([], $author[self::ATTR]); + Assert::equals('author', $author[self::NAME]); + Assert::equals([], $author[self::ATTR]); with ($name= $author[self::CHLD][0]); { - $this->assertEquals('name', $name[self::NAME]); - $this->assertEquals([], $name[self::ATTR]); - $this->assertEquals(['Timm'], $name[self::CHLD]); + Assert::equals('name', $name[self::NAME]); + Assert::equals([], $name[self::ATTR]); + Assert::equals(['Timm'], $name[self::CHLD]); } } with ($chapter= $callback->tree[self::CHLD][3]); { - $this->assertEquals('chapter', $chapter[self::NAME]); - $this->assertEquals(['id' => '1'], $chapter[self::ATTR]); + Assert::equals('chapter', $chapter[self::NAME]); + Assert::equals(['id' => '1'], $chapter[self::ATTR]); with ($title= $chapter[self::CHLD][1]); { - $this->assertEquals('title', $title[self::NAME]); - $this->assertEquals([], $title[self::ATTR]); - $this->assertEquals(['Introduction'], $title[self::CHLD]); + Assert::equals('title', $title[self::NAME]); + Assert::equals([], $title[self::ATTR]); + Assert::equals(['Introduction'], $title[self::CHLD]); } with ($paragraph= $chapter[self::CHLD][3]); { - $this->assertEquals('paragraph', $paragraph[self::NAME]); - $this->assertEquals([], $paragraph[self::ATTR]); - $this->assertEquals(['This is where it all started.'], $paragraph[self::CHLD]); + Assert::equals('paragraph', $paragraph[self::NAME]); + Assert::equals([], $paragraph[self::ATTR]); + Assert::equals(['This is where it all started.'], $paragraph[self::CHLD]); } } } @@ -156,7 +153,7 @@ public function reusable() { $callback= $this->newCallback(); $this->parser->setCallback($callback); $this->parser->parse($this->source('')); - $this->assertEquals( + Assert::equals( ['run', ['id' => (string)$i], []], $callback->tree, 'Run #'.$i @@ -172,13 +169,13 @@ public function errorOccursLate() { $this->parser->parse($this->source('

Title

Text

')); $this->fail('Parsed without problems', null, 'xml.XMLFormatException'); } catch (\xml\XMLFormatException $expected) { - $this->assertEquals(null, $callback->tree, 'Tree only set if entire doc parsed'); + Assert::equals(null, $callback->tree, 'Tree only set if entire doc parsed'); - $this->assertEquals(4, sizeof($callback->elements)); - $this->assertEquals('doc', $callback->elements[0]); - $this->assertEquals('h1', $callback->elements[1]); - $this->assertEquals('p', $callback->elements[2]); - $this->assertEquals('img', $callback->elements[3]); + Assert::equals(4, sizeof($callback->elements)); + Assert::equals('doc', $callback->elements[0]); + Assert::equals('h1', $callback->elements[1]); + Assert::equals('p', $callback->elements[2]); + Assert::equals('img', $callback->elements[3]); } } @@ -227,7 +224,7 @@ public function quotesInsideAttributes() { $callback= $this->newCallback(); $this->parser->setCallback($callback); $this->parser->parse($this->source('')); - $this->assertEquals( + Assert::equals( ['n', ['id' => "'1'", 't' => '"_new"', 'q' => '\'"'], []], $callback->tree ); @@ -238,7 +235,7 @@ public function greaterSignInAttribute() { $callback= $this->newCallback(); $this->parser->setCallback($callback); $this->parser->parse($this->source('')); - $this->assertEquals( + Assert::equals( ['a', ['id' => '>'], []], $callback->tree ); @@ -256,7 +253,7 @@ public function cdataSection() { $this->parser->parse($this->source(' CDATA [ ]]>] ')); - $this->assertEquals([ + Assert::equals([ 'doc', [], [ 'CDATA [', '<&>', ']' ] @@ -269,7 +266,7 @@ public function processingInstruction() { $this->parser->setCallback($callback); $this->parser->parse($this->source('')); - $this->assertEquals([ + Assert::equals([ 'doc', [], [ '' ] @@ -282,7 +279,7 @@ public function comment() { $this->parser->setCallback($callback); $this->parser->parse($this->source('')); - $this->assertEquals([ + Assert::equals([ 'doc', [], [ '' ] @@ -306,7 +303,7 @@ public function predefinedEntities() { "3 < 5 '&' 5 > 3" ')); - $this->assertEquals([ + Assert::equals([ 'doc', [], [ '"', '3', '<', '5', "'", '&', "'", '5', '>', '3', '"' ] @@ -321,7 +318,7 @@ public function hexEntity() { © 2001-2009 the XP team ')); - $this->assertEquals([ + Assert::equals([ 'doc', [], [ '©', '2001-2009 the XP team' ] @@ -337,8 +334,8 @@ public function iso88591Conversion() { The übercoder returns ')); - $this->assertEquals('iso-8859-1', $callback->encoding); - $this->assertEquals([ + Assert::equals('iso-8859-1', $callback->encoding); + Assert::equals([ 'doc', [], [ 'The', 'übercoder returns' ] @@ -354,8 +351,8 @@ public function utf8Conversion() { The übercoder returns ')); - $this->assertEquals('utf-8', $callback->encoding); - $this->assertEquals([ + Assert::equals('utf-8', $callback->encoding); + Assert::equals([ 'doc', [], [ 'The', 'übercoder returns' ] @@ -391,7 +388,7 @@ public function characterEntity() { Copyright: © ')); - $this->assertEquals([ + Assert::equals([ 'doc', [], [ 'Copyright:', '©' ] @@ -407,7 +404,7 @@ public function entity() { Copyright: ©right; ')); - $this->assertEquals([ + Assert::equals([ 'doc', [], [ 'Copyright:', '©right;' ] @@ -423,7 +420,7 @@ public function entityInAttribute() { ')); - $this->assertEquals([ + Assert::equals([ 'doc', [], [ ['book', ['copyright' => 'Copyright 2009 The XP team'], []], ] @@ -442,7 +439,7 @@ public function entityExpansion() { ')); - $this->assertEquals([ + Assert::equals([ 'doc', [], [ ['book', ['copyright' => 'Copyright 2009 The XP team'], []], ] @@ -458,7 +455,7 @@ public function externalEntity() { Copyright: ©right; ')); - $this->assertEquals([ + Assert::equals([ 'doc', [], ['Copyright:'], ], $callback->tree); } diff --git a/src/test/php/xml/unittest/ApplicationType.class.php b/src/test/php/xml/unittest/ApplicationType.class.php index 35d41723..4cd218cd 100755 --- a/src/test/php/xml/unittest/ApplicationType.class.php +++ b/src/test/php/xml/unittest/ApplicationType.class.php @@ -2,13 +2,7 @@ use xml\Xmlns; -/** - * Test class for Marshaller / Unmarshaller tests - * - * @see xp://xml.unittest.UnmarshallerTest - * @see xp://xml.unittest.MarshallerTest - */ #[Xmlns(app: 'http://projects.xp-framework.net/xmlns/app')] class ApplicationType { -} +} \ No newline at end of file diff --git a/src/test/php/xml/unittest/ButtonType.class.php b/src/test/php/xml/unittest/ButtonType.class.php index 6dc86e89..45f8ae0d 100755 --- a/src/test/php/xml/unittest/ButtonType.class.php +++ b/src/test/php/xml/unittest/ButtonType.class.php @@ -2,12 +2,6 @@ use xml\{Xmlfactory, Xmlmapping}; -/** - * Test class for Marshaller / Unmarshaller tests. Used by - * DialogType. - * - * @see xp://xml.unittest.DialogType - */ class ButtonType { public $id= ''; public $caption= ''; diff --git a/src/test/php/xml/unittest/DialogType.class.php b/src/test/php/xml/unittest/DialogType.class.php index abd22612..ffd68698 100755 --- a/src/test/php/xml/unittest/DialogType.class.php +++ b/src/test/php/xml/unittest/DialogType.class.php @@ -2,13 +2,6 @@ use xml\{Xmlfactory, Xmlmapping}; -/** - * Test class for Marshaller / Unmarshaller tests - * - * @see xp://xml.unittest.UnmarshallerTest - * @see xp://xml.unittest.MarshallerTest - * @see rfc://0040 - */ class DialogType { public $id = '', diff --git a/src/test/php/xml/unittest/DocumentTest.class.php b/src/test/php/xml/unittest/DocumentTest.class.php index 871ba083..3cc9ae48 100755 --- a/src/test/php/xml/unittest/DocumentTest.class.php +++ b/src/test/php/xml/unittest/DocumentTest.class.php @@ -1,14 +1,9 @@ Alex '); - $this->assertEquals( + Assert::equals( $dom->getDocumentElement()->getChildren(), $dom->getElementsByTagName('person') ); @@ -30,7 +25,7 @@ public function elementById() { Alex '); - $this->assertEquals( + Assert::equals( $dom->getDocumentElement()->nodeAt(0), $dom->getElementById('1549') ); @@ -46,7 +41,7 @@ public function elementsByName() { '); - $this->assertEquals( + Assert::equals( [$dom->getDocumentElement()->nodeAt(0)->nodeAt(0)], $dom->getElementsByName('package') ); @@ -67,7 +62,7 @@ public function nestedElementById() { '); - $this->assertEquals( + Assert::equals( $dom->getDocumentElement()->nodeAt(1)->nodeAt(0)->nodeAt(0)->nodeAt(0), $dom->getElementById('home') ); @@ -75,7 +70,7 @@ public function nestedElementById() { #[Test] public function noSuchElementById() { - $this->assertEquals( + Assert::equals( null, Document::fromString('')->getElementById('1777') ); diff --git a/src/test/php/xml/unittest/DomXslProcessorTest.class.php b/src/test/php/xml/unittest/DomXslProcessorTest.class.php index 37568d16..664dc172 100755 --- a/src/test/php/xml/unittest/DomXslProcessorTest.class.php +++ b/src/test/php/xml/unittest/DomXslProcessorTest.class.php @@ -2,16 +2,10 @@ use io\FileNotFoundException; use lang\{ElementNotFoundException, IllegalArgumentException}; +use unittest\Assert; use unittest\{Expect, Test, Xslmethod}; use xml\{DomXSLProcessor, TransformerException}; -/** - * ProcessorTest implementation that tests the DomXSL processor - * - * @see xp://xml.DomXSLProcessor - * @ext dom - * @ext xsl - */ class DomXslProcessorTest extends AbstractProcessorTest { /** @@ -203,7 +197,7 @@ public function errorStackDoesNotAffectErrorHandling() { $i->setXMLBuf(' '); $this->fail('Malformed XML did not trigger exception'); } catch (\xml\TransformerException $e) { - $this->assertTrue((bool)strstr($e->getMessage(), "Entity 'nbsp' not defined")); + Assert::true((bool)strstr($e->getMessage(), "Entity 'nbsp' not defined")); } } @@ -254,6 +248,6 @@ public function processDocuments() { $this->setXSLDoc(); $this->setXMLDoc(); $this->processor->run(); - $this->assertEquals('document', $this->processor->output()); + Assert::equals('document', $this->processor->output()); } } \ No newline at end of file diff --git a/src/test/php/xml/unittest/MarshallerTest.class.php b/src/test/php/xml/unittest/MarshallerTest.class.php index 4c54115f..f69199be 100755 --- a/src/test/php/xml/unittest/MarshallerTest.class.php +++ b/src/test/php/xml/unittest/MarshallerTest.class.php @@ -1,21 +1,18 @@ fixture= new Marshaller(); } @@ -30,7 +27,7 @@ public function setUp() { * @throws unittest.AssertionFailedError */ public function assertMarshalled($expect, $node) { - $this->assertEquals( + Assert::equals( preg_replace('#>[\s\r\n]+<#', '><', trim($expect)), preg_replace('#>[\s\r\n]+<#', '><', trim($node->getSource(INDENT_DEFAULT))) ); @@ -39,7 +36,7 @@ public function assertMarshalled($expect, $node) { #[Test] public function marshalToReturnsGivenNode() { $n= new Node('node'); - $this->assertEquals($n, $this->fixture->marshalTo($n, new Some())); + Assert::equals($n, $this->fixture->marshalTo($n, new Some())); } #[Test] @@ -57,12 +54,12 @@ public function nameOfNodeUsed() { #[Test] public function marshalToCreatesNewNodeWhenNoneGiven() { - $this->assertEquals(new Node('some'), $this->fixture->marshalTo(null, new Some())); + Assert::equals(new Node('some'), $this->fixture->marshalTo(null, new Some())); } #[Test] public function classAnnotationSuppliesName() { - $this->assertEquals(new Node('scroll'), $this->fixture->marshalTo(null, new ScrollBarType())); + Assert::equals(new Node('scroll'), $this->fixture->marshalTo(null, new ScrollBarType())); } #[Test] @@ -140,15 +137,15 @@ public function asTree() { $dialog->setId('file.open'); $node= $this->fixture->marshalTo(new Node('dialog'), $dialog); - $this->assertInstanceOf(Node::class, $node); - $this->assertEquals('dialog', $node->getName()); - $this->assertEquals('file.open', $node->getAttribute('id')); + Assert::instance(Node::class, $node); + Assert::equals('dialog', $node->getName()); + Assert::equals('file.open', $node->getAttribute('id')); } #[Test] public function deprecatedUsage() { $dialog= new DialogType(); - $this->assertEquals( + Assert::equals( Marshaller::marshal($dialog), $this->fixture->marshalTo(new Node('dialogtype'), $dialog)->getSource(INDENT_DEFAULT) ); @@ -157,7 +154,7 @@ public function deprecatedUsage() { #[Test] public function deprecatedUsageWithNamespace() { $app= new ApplicationType(); - $this->assertEquals( + Assert::equals( Marshaller::marshal($app), $this->fixture->marshalTo(new Node('ApplicationType'), $app)->getSource(INDENT_DEFAULT) ); diff --git a/src/test/php/xml/unittest/NodeTest.class.php b/src/test/php/xml/unittest/NodeTest.class.php index 280bcec9..1b62c80f 100755 --- a/src/test/php/xml/unittest/NodeTest.class.php +++ b/src/test/php/xml/unittest/NodeTest.class.php @@ -1,15 +1,11 @@ setAttribute('id', 1); - $this->assertTrue($n->hasAttribute('id')); - $this->assertFalse($n->hasAttribute('href')); - $this->assertEquals(1, $n->getAttribute('id')); + Assert::true($n->hasAttribute('id')); + Assert::false($n->hasAttribute('href')); + Assert::equals(1, $n->getAttribute('id')); } #[Test] @@ -36,14 +32,14 @@ public function contentAccessors() { $content= '"This is interesting", Tom\'s friend said. "It\'s > 4 but < 2!"'; $n= new Node('node'); $n->setContent($content); - $this->assertEquals($content, $n->getContent()); + Assert::equals($content, $n->getContent()); } #[Test] public function nameAccessors() { $n= new Node('node'); $n->setName('name'); - $this->assertEquals('name', $n->getName()); + Assert::equals('name', $n->getName()); } #[Test, Expect(XMLFormatException::class)] @@ -61,19 +57,19 @@ public function addingNullChild() { public function addingReturnsChild() { $n= new Node('node'); $child= new Node('node'); - $this->assertEquals($child, $n->addChild($child)); + Assert::equals($child, $n->addChild($child)); } #[Test] public function withChildReturnsNode() { $n= new Node('node'); $child= new Node('node'); - $this->assertEquals($n, $n->withChild($child)); + Assert::equals($n, $n->withChild($child)); } #[Test] public function fromEmptyArray() { - $this->assertEquals( + Assert::equals( '', $this->sourceOf(Node::fromArray([], 'node')) ); @@ -81,7 +77,7 @@ public function fromEmptyArray() { #[Test] public function fromNumberArray() { - $this->assertEquals( + Assert::equals( '12', $this->sourceOf(Node::fromArray([1, 2], 'items'), INDENT_NONE) ); @@ -89,7 +85,7 @@ public function fromNumberArray() { #[Test] public function fromCharacterArray() { - $this->assertEquals( + Assert::equals( '1&1', $this->sourceOf(Node::fromArray(['1', '&', '1'], 'characters'), INDENT_NONE) ); @@ -97,7 +93,7 @@ public function fromCharacterArray() { #[Test] public function sourceOfEmptyNode() { - $this->assertEquals( + Assert::equals( '', $this->sourceOf(new Node('node')) ); @@ -105,7 +101,7 @@ public function sourceOfEmptyNode() { #[Test] public function sourceOfNodeWithOneAttribute() { - $this->assertEquals( + Assert::equals( '', $this->sourceOf(new Node('node', null, ['id' => 1])) ); @@ -113,7 +109,7 @@ public function sourceOfNodeWithOneAttribute() { #[Test] public function sourceOfNodeWithTwoAttributes() { - $this->assertEquals( + Assert::equals( '', $this->sourceOf(new Node('node', null, ['id' => 2, 'name' => '&XML'])) ); @@ -121,7 +117,7 @@ public function sourceOfNodeWithTwoAttributes() { #[Test] public function sourceOfNodeWithContent() { - $this->assertEquals( + Assert::equals( 'eval(\'1 <> 2 && \') == "Parse Error"', $this->sourceOf(new Node('expr', 'eval(\'1 <> 2 && \') == "Parse Error"')) ); @@ -129,7 +125,7 @@ public function sourceOfNodeWithContent() { #[Test] public function sourceOfNodeWithCData() { - $this->assertEquals( + Assert::equals( '"\'&]]>', $this->sourceOf(new Node('text', new \xml\CData('Special characters: <>"\'&'))) ); @@ -137,7 +133,7 @@ public function sourceOfNodeWithCData() { #[Test] public function sourceOfNodeWithPCData() { - $this->assertEquals( + Assert::equals( 'A link to click on', $this->sourceOf(new Node('text', new \xml\PCData('A link to click on'))) ); @@ -145,7 +141,7 @@ public function sourceOfNodeWithPCData() { #[Test] public function getSourceWithDefaultEncoding() { - $this->assertEquals( + Assert::equals( "\xc3\x9cbercoder", (new Node('n', "Übercoder"))->getSource(INDENT_NONE) ); @@ -153,7 +149,7 @@ public function getSourceWithDefaultEncoding() { #[Test] public function getSourceWithIsoEncoding() { - $this->assertEquals( + Assert::equals( "\xdcbercoder", (new Node('n', "Übercoder"))->getSource(INDENT_NONE, 'iso-8859-1') ); @@ -161,7 +157,7 @@ public function getSourceWithIsoEncoding() { #[Test] public function getSourceWithUtf8Encoding() { - $this->assertEquals( + Assert::equals( "\xc3\x9cbercoder", (new Node('n', "Übercoder"))->getSource(INDENT_NONE, 'utf-8') ); @@ -169,7 +165,7 @@ public function getSourceWithUtf8Encoding() { #[Test] public function fromObject() { - $this->assertEquals( + Assert::equals( "\n". " 1549\n". " green\n". @@ -189,7 +185,7 @@ public function __construct() { #[Test] public function fromObject_uses_short_name_if_omitted() { - $this->assertEquals( + Assert::equals( '', $this->sourceOf(Node::fromObject(new Some(), null)) ); @@ -197,7 +193,7 @@ public function fromObject_uses_short_name_if_omitted() { #[Test] public function fromObject_invokes_serialize() { - $this->assertEquals( + Assert::equals( "\n". " test\n". "", @@ -211,7 +207,7 @@ public function __serialize() { #[Test] public function as_string() { - $this->assertEquals( + Assert::equals( 'xml.Node(doc) { }', (new Node('doc'))->toString() ); @@ -219,7 +215,7 @@ public function as_string() { #[Test] public function as_string_with_content() { - $this->assertEquals( + Assert::equals( 'xml.Node(test) { "Succeeded" }', (new Node('test', 'Succeeded'))->toString() ); @@ -227,7 +223,7 @@ public function as_string_with_content() { #[Test] public function as_string_with_attributes() { - $this->assertEquals( + Assert::equals( 'xml.Node(a @href= "http://example.com") { }', (new Node('a', null, ['href' => 'http://example.com']))->toString() ); @@ -235,7 +231,7 @@ public function as_string_with_attributes() { #[Test] public function as_string_with_children() { - $this->assertEquals( + Assert::equals( "xml.Node(div) {\n". " xml.Node(p) { \"Test\" }\n". "}", diff --git a/src/test/php/xml/unittest/RDFNewsFeedTest.class.php b/src/test/php/xml/unittest/RDFNewsFeedTest.class.php index c3ed905b..fea29a98 100755 --- a/src/test/php/xml/unittest/RDFNewsFeedTest.class.php +++ b/src/test/php/xml/unittest/RDFNewsFeedTest.class.php @@ -1,11 +1,12 @@ assertEquals( + Assert::equals( 'setChannel('Channel', 'http://example.com/channel', 'Description', new \util\Date('2013-02-27 10:37:12 +01:00')); - $this->assertEquals( + Assert::equals( 'setChannel('Channel', 'http://example.com/channel', 'Description', new \util\Date('2013-02-27 10:37:12 +01:00')); $f->addItem('Item', 'http://example.com/channel/item/1', 'Description', new \util\Date('2013-02-28 14:12:36 +01:00')); - $this->assertEquals( + Assert::equals( 'setChannel('Channel', 'http://example.com/channel', 'Description', new \util\Date('2013-02-27 10:37:12 +01:00')); $f->addItem('Item 1', 'http://example.com/channel/item/1', 'Description 1', new \util\Date('2013-02-28 14:12:36 +01:00')); $f->addItem('Item 2', 'http://example.com/channel/item/2', 'Description 2', new \util\Date('2013-02-28 14:12:37 +01:00')); - $this->assertEquals( + Assert::equals( 'setChannel('Channel', 'http://localhost/', 'Channel description', new Date('1980-05-28 00:00:00+0200'), 'english', 'Alex Kiesel', 'Alex Kiesel', 'rights'); - $this->assertEquals( + Assert::equals( 'setChannel('Channel', 'http://localhost/', 'Channel description', new Date('1980-05-28 00:00:00+0200'), 'english', 'Alex Kiesel', 'Alex Kiesel', 'rights'); $f->addItem('Item 1', 'http://localhost/item/1', 'Item description', new Date('2013-04-03 00:00:00+0200')); - $this->assertEquals( + Assert::equals( '' : '').$str), - $this->name.' test' + nameof($this).' test' ); } } \ No newline at end of file diff --git a/src/test/php/xml/unittest/StringXMLParserTest.class.php b/src/test/php/xml/unittest/StringXMLParserTest.class.php index 385e04ac..863dac09 100755 --- a/src/test/php/xml/unittest/StringXMLParserTest.class.php +++ b/src/test/php/xml/unittest/StringXMLParserTest.class.php @@ -1,10 +1,7 @@ ' : '').$str, - $this->name.' test' + nameof($this).' test' ); } } \ No newline at end of file diff --git a/src/test/php/xml/unittest/StylesheetTest.class.php b/src/test/php/xml/unittest/StylesheetTest.class.php index b31a0731..e599e333 100755 --- a/src/test/php/xml/unittest/StylesheetTest.class.php +++ b/src/test/php/xml/unittest/StylesheetTest.class.php @@ -1,15 +1,11 @@ assertEquals( + Assert::equals( '', trim((new Stylesheet())->getSource(INDENT_DEFAULT)) ); @@ -47,7 +43,7 @@ public function setOutputMethod() { $s= new Stylesheet(); $s->setOutputMethod('text', false, 'utf-8'); - $this->assertEquals( + Assert::equals( '', trim($this->getElementsByTagName($s->root, 'xsl:output')->get(0)->getSource(INDENT_NONE)) ); @@ -57,7 +53,7 @@ public function setOutputMethod() { public function withOutputMethod() { $s= (new Stylesheet())->withOutputMethod('text', false, 'utf-8'); - $this->assertEquals( + Assert::equals( '', trim($this->getElementsByTagName($s->root, 'xsl:output')->get(0)->getSource(INDENT_NONE)) ); @@ -68,7 +64,7 @@ public function addImport() { $s= new Stylesheet(); $s->addImport('portlets/welcome.portlet.xsl'); - $this->assertEquals( + Assert::equals( '', trim($this->getElementsByTagName($s->root, 'xsl:import')->get(0)->getSource(INDENT_NONE)) ); @@ -78,7 +74,7 @@ public function addImport() { public function withImport() { $s= (new Stylesheet())->withImport('portlets/welcome.portlet.xsl'); - $this->assertEquals( + Assert::equals( '', trim($this->getElementsByTagName($s->root, 'xsl:import')->get(0)->getSource(INDENT_NONE)) ); @@ -89,7 +85,7 @@ public function addInclude() { $s= new Stylesheet(); $s->addInclude('portlets/welcome.portlet.xsl'); - $this->assertEquals( + Assert::equals( '', trim($this->getElementsByTagName($s->root, 'xsl:include')->get(0)->getSource(INDENT_NONE)) ); @@ -99,7 +95,7 @@ public function addInclude() { public function withInclude() { $s= (new Stylesheet())->withInclude('portlets/welcome.portlet.xsl'); - $this->assertEquals( + Assert::equals( '', trim($this->getElementsByTagName($s->root, 'xsl:include')->get(0)->getSource(INDENT_NONE)) ); @@ -110,7 +106,7 @@ public function addParam() { $s= new Stylesheet(); $s->addParam('session'); - $this->assertEquals( + Assert::equals( '', trim($this->getElementsByTagName($s->root, 'xsl:param')->get(0)->getSource(INDENT_NONE)) ); @@ -120,7 +116,7 @@ public function addParam() { public function withParam() { $s= (new Stylesheet())->withParam('session'); - $this->assertEquals( + Assert::equals( '', trim($this->getElementsByTagName($s->root, 'xsl:param')->get(0)->getSource(INDENT_NONE)) ); @@ -131,7 +127,7 @@ public function addVariable() { $s= new Stylesheet(); $s->addVariable('session'); - $this->assertEquals( + Assert::equals( '', trim($this->getElementsByTagName($s->root, 'xsl:variable')->get(0)->getSource(INDENT_NONE)) ); @@ -144,11 +140,11 @@ public function addVariables() { $s->addVariable('language'); $variables= $this->getElementsByTagName($s->root, 'xsl:variable'); - $this->assertEquals( + Assert::equals( '', trim($variables->get(0)->getSource(INDENT_NONE)) ); - $this->assertEquals( + Assert::equals( '', trim($variables->get(1)->getSource(INDENT_NONE)) ); @@ -158,7 +154,7 @@ public function addVariables() { public function withVariable() { $s= (new Stylesheet())->withVariable('session'); - $this->assertEquals( + Assert::equals( '', trim($this->getElementsByTagName($s->root, 'xsl:variable')->get(0)->getSource(INDENT_NONE)) ); @@ -169,7 +165,7 @@ public function addMatchTemplate() { $s= new Stylesheet(); $s->addTemplate((new \xml\XslTemplate())->matching('/')); - $this->assertEquals( + Assert::equals( '', trim($this->getElementsByTagName($s->root, 'xsl:template')->get(0)->getSource(INDENT_NONE)) ); @@ -179,7 +175,7 @@ public function addMatchTemplate() { public function withMatchTemplate() { $s= (new Stylesheet())->withTemplate((new \xml\XslTemplate())->matching('/')); - $this->assertEquals( + Assert::equals( '', trim($this->getElementsByTagName($s->root, 'xsl:template')->get(0)->getSource(INDENT_NONE)) ); @@ -190,7 +186,7 @@ public function addNamedTemplate() { $s= new Stylesheet(); $s->addTemplate((new \xml\XslTemplate())->named('sitemap')); - $this->assertEquals( + Assert::equals( '', trim($this->getElementsByTagName($s->root, 'xsl:template')->get(0)->getSource(INDENT_NONE)) ); @@ -200,7 +196,7 @@ public function addNamedTemplate() { public function withNamedTemplate() { $s= (new Stylesheet())->withTemplate((new \xml\XslTemplate())->named('sitemap')); - $this->assertEquals( + Assert::equals( '', trim($this->getElementsByTagName($s->root, 'xsl:template')->get(0)->getSource(INDENT_NONE)) ); diff --git a/src/test/php/xml/unittest/TextInputType.class.php b/src/test/php/xml/unittest/TextInputType.class.php index 5f5bb9e0..2c913367 100755 --- a/src/test/php/xml/unittest/TextInputType.class.php +++ b/src/test/php/xml/unittest/TextInputType.class.php @@ -2,12 +2,6 @@ use xml\{Xmlfactory, Xmlmapping}; -/** - * Test class for Marshaller / Unmarshaller tests. - * - * @see xp://xml.unittest.UnmarshallerTest - * @see xp://xml.unittest.MarshallerTest - */ class TextInputType { protected $id= ''; protected $disabled= false; diff --git a/src/test/php/xml/unittest/TreeTest.class.php b/src/test/php/xml/unittest/TreeTest.class.php index 5a3a7d11..ad2e69f5 100755 --- a/src/test/php/xml/unittest/TreeTest.class.php +++ b/src/test/php/xml/unittest/TreeTest.class.php @@ -1,16 +1,12 @@ assertEquals( + Assert::equals( '', $this->sourceOf(new Tree('root')) ); @@ -34,10 +30,10 @@ public function emptyTree() { #[Test] public function rootMember() { with ($t= new Tree('formresult'), $r= $t->root()); { - $this->assertInstanceOf(Node::class, $r); - $this->assertFalse($r->hasChildren()); - $this->assertEquals([], $r->getAttributes()); - $this->assertEquals('formresult', $r->getName()); + Assert::instance(Node::class, $r); + Assert::false($r->hasChildren()); + Assert::equals([], $r->getAttributes()); + Assert::equals('formresult', $r->getName()); } } @@ -45,7 +41,7 @@ public function rootMember() { public function addChild() { $t= new Tree('tests'); $child= new Node('test', 'success', ['name' => 'TreeTest']); - $this->assertEquals($child, $t->addChild($child)); + Assert::equals($child, $t->addChild($child)); } #[Test] @@ -57,18 +53,18 @@ public function fromString() { '); with ($r= $t->root()); { - $this->assertEquals('c:config', $r->getName()); - $this->assertTrue($r->hasAttribute('xmlns:c')); - $this->assertEquals('http://example.com/cfg/1.0', $r->getAttribute('xmlns:c')); - $this->assertEquals(1, sizeof($r->getChildren())); + Assert::equals('c:config', $r->getName()); + Assert::true($r->hasAttribute('xmlns:c')); + Assert::equals('http://example.com/cfg/1.0', $r->getAttribute('xmlns:c')); + Assert::equals(1, sizeof($r->getChildren())); } with ($c= $t->root()->nodeAt(0)); { - $this->assertEquals('attribute', $c->getName()); - $this->assertTrue($c->hasAttribute('name')); - $this->assertEquals('key', $c->getAttribute('name')); - $this->assertEquals(0, sizeof($c->getChildren())); - $this->assertEquals('value', $c->getContent()); + Assert::equals('attribute', $c->getName()); + Assert::true($c->hasAttribute('name')); + Assert::equals('key', $c->getAttribute('name')); + Assert::equals(0, sizeof($c->getChildren())); + Assert::equals('value', $c->getContent()); } } @@ -78,10 +74,10 @@ public function fromStringEncodingIso88591() { Some umlauts: öäü ')); - $this->assertEquals('utf-8', $tree->getEncoding()); - $this->assertEquals(1, sizeof($tree->root()->getChildren())); - $this->assertEquals('document', $tree->root()->getName()); - $this->assertEquals('Some umlauts: öäü', $tree->root()->nodeAt(0)->getContent()); + Assert::equals('utf-8', $tree->getEncoding()); + Assert::equals(1, sizeof($tree->root()->getChildren())); + Assert::equals('document', $tree->root()->getName()); + Assert::equals('Some umlauts: öäü', $tree->root()->nodeAt(0)->getContent()); } #[Test] @@ -90,18 +86,18 @@ public function fromStringEncodingUTF8() { Some umlauts: öäü '); - $this->assertEquals('utf-8', $tree->getEncoding()); - $this->assertEquals(1, sizeof($tree->root()->getChildren())); - $this->assertEquals('document', $tree->root()->getName()); - $this->assertEquals('Some umlauts: öäü', $tree->root()->nodeAt(0)->getContent()); + Assert::equals('utf-8', $tree->getEncoding()); + Assert::equals(1, sizeof($tree->root()->getChildren())); + Assert::equals('document', $tree->root()->getName()); + Assert::equals('Some umlauts: öäü', $tree->root()->nodeAt(0)->getContent()); } #[Test] public function singleElement() { $tree= Tree::fromString('Content'); - $this->assertEquals(0, sizeof($tree->root()->getChildren())); - $this->assertEquals('Content', $tree->root()->getContent()); - $this->assertEquals('false', $tree->root()->getAttribute('empty')); + Assert::equals(0, sizeof($tree->root()->getChildren())); + Assert::equals('Content', $tree->root()->getContent()); + Assert::equals('false', $tree->root()->getAttribute('empty')); } #[Test, Expect(XMLFormatException::class)] @@ -114,8 +110,8 @@ public function utf8Encoding() { $t= (new Tree('unicode'))->withEncoding('UTF-8'); $t->root()->setContent('Hällo'); - $this->assertEquals('', $t->getDeclaration()); - $this->assertEquals('Hällo', $this->sourceOf($t)); + Assert::equals('', $t->getDeclaration()); + Assert::equals('Hällo', $this->sourceOf($t)); } #[Test] @@ -123,8 +119,8 @@ public function iso88591Encoding() { $t= (new Tree('unicode'))->withEncoding('iso-8859-1'); $t->root()->setContent('Hällo'); - $this->assertEquals('', $t->getDeclaration()); - $this->assertEquals(iconv(\xp::ENCODING, 'iso-8859-1', 'Hällo'), $this->sourceOf($t)); + Assert::equals('', $t->getDeclaration()); + Assert::equals(iconv(\xp::ENCODING, 'iso-8859-1', 'Hällo'), $this->sourceOf($t)); } #[Test, Ignore('Performance testing')] @@ -149,10 +145,10 @@ public function parseIntoUtf8() { Some umlauts: öäü ')); - $this->assertEquals('utf-8', $tree->getEncoding()); - $this->assertEquals(1, sizeof($tree->root()->getChildren())); - $this->assertEquals('document', $tree->root()->getName()); - $this->assertEquals('Some umlauts: öäü', $tree->root()->nodeAt(0)->getContent()); + Assert::equals('utf-8', $tree->getEncoding()); + Assert::equals(1, sizeof($tree->root()->getChildren())); + Assert::equals('document', $tree->root()->getName()); + Assert::equals('Some umlauts: öäü', $tree->root()->nodeAt(0)->getContent()); } #[Test] @@ -163,15 +159,15 @@ public function parseIntoIso() { Some umlauts: öäü ')); - $this->assertEquals('iso-8859-1', $tree->getEncoding()); - $this->assertEquals(1, sizeof($tree->root()->getChildren())); - $this->assertEquals('document', $tree->root()->getName()); - $this->assertEquals('Some umlauts: öäü', $tree->root()->nodeAt(0)->getContent()); + Assert::equals('iso-8859-1', $tree->getEncoding()); + Assert::equals(1, sizeof($tree->root()->getChildren())); + Assert::equals('document', $tree->root()->getName()); + Assert::equals('Some umlauts: öäü', $tree->root()->nodeAt(0)->getContent()); } #[Test] public function as_string() { - $this->assertEquals( + Assert::equals( "xml.Tree(version=1.0 encoding=utf-8)@{\n". " xml.Node(doc) { }\n". "}", diff --git a/src/test/php/xml/unittest/UnmarshallerTest.class.php b/src/test/php/xml/unittest/UnmarshallerTest.class.php index b9d83689..0e77ad98 100755 --- a/src/test/php/xml/unittest/UnmarshallerTest.class.php +++ b/src/test/php/xml/unittest/UnmarshallerTest.class.php @@ -1,25 +1,21 @@ fixture= new Unmarshaller(); } @@ -32,8 +28,8 @@ public function idAttribute() { ')), 'xml.unittest.DialogType' ); - $this->assertInstanceOf(DialogType::class, $dialog); - $this->assertEquals('file.open', $dialog->getId()); + Assert::instance(DialogType::class, $dialog); + Assert::equals('file.open', $dialog->getId()); } #[Test] @@ -44,8 +40,8 @@ public function captionNode() { ')), 'xml.unittest.DialogType' ); - $this->assertInstanceOf(DialogType::class, $dialog); - $this->assertEquals('Open a file > Choose', $dialog->getCaption()); + Assert::instance(DialogType::class, $dialog); + Assert::equals('Open a file > Choose', $dialog->getCaption()); } #[Test] @@ -58,17 +54,17 @@ public function buttonsNodeSet() { ')), 'xml.unittest.DialogType' ); - $this->assertInstanceOf(DialogType::class, $dialog); - $this->assertTrue($dialog->hasButtons()); - $this->assertEquals(2, $dialog->numButtons()); + Assert::instance(DialogType::class, $dialog); + Assert::true($dialog->hasButtons()); + Assert::equals(2, $dialog->numButtons()); with ($ok= $dialog->buttonAt(0), $cancel= $dialog->buttonAt(1)); { - $this->assertInstanceOf(ButtonType::class, $ok); - $this->assertInstanceOf(ButtonType::class, $cancel); - $this->assertEquals('ok', $ok->getId()); - $this->assertEquals('cancel', $cancel->getId()); - $this->assertEquals('Yes, go ahead', $ok->getCaption()); - $this->assertEquals('No, please don\'t!', $cancel->getCaption()); + Assert::instance(ButtonType::class, $ok); + Assert::instance(ButtonType::class, $cancel); + Assert::equals('ok', $ok->getId()); + Assert::equals('cancel', $cancel->getId()); + Assert::equals('Yes, go ahead', $ok->getCaption()); + Assert::equals('No, please don\'t!', $cancel->getCaption()); } } @@ -80,8 +76,8 @@ public function usingPassWithScalars() { ')), 'xml.unittest.DialogType' ); - $this->assertInstanceOf(DialogType::class, $dialog); - $this->assertEquals(['ON_TOP', 'MODAL'], $dialog->getFlags()); + Assert::instance(DialogType::class, $dialog); + Assert::equals(['ON_TOP', 'MODAL'], $dialog->getFlags()); } #[Test] @@ -95,8 +91,8 @@ public function usingPassWithNodes() { ')), 'xml.unittest.DialogType' ); - $this->assertInstanceOf(DialogType::class, $dialog); - $this->assertEquals([ + Assert::instance(DialogType::class, $dialog); + Assert::equals([ 'width' => '100', 'height' => '100' ], $dialog->getOptions()); @@ -108,8 +104,8 @@ public function unmarshallingAnInputStream() { new StreamInputSource(new MemoryInputStream(''), 'memory'), 'xml.unittest.DialogType' ); - $this->assertInstanceOf(DialogType::class, $dialog); - $this->assertEquals('stream.select', $dialog->getId()); + Assert::instance(DialogType::class, $dialog); + Assert::equals('stream.select', $dialog->getId()); } #[Test, Expect(XMLFormatException::class)] @@ -132,7 +128,7 @@ public function emptyStream() { public function deprecatedUsage() { $xml= ''; $type= 'xml.unittest.DialogType'; - $this->assertEquals( + Assert::equals( Unmarshaller::unmarshal($xml, $type), $this->fixture->unmarshalFrom(new StreamInputSource(new MemoryInputStream($xml)), $type) ); @@ -160,7 +156,7 @@ public function nameBasedFactoryToDialog() { new StreamInputSource(new MemoryInputStream('')), 'xml.unittest.NameBasedTypeFactory' ); - $this->assertInstanceOf(DialogType::class, $object); + Assert::instance(DialogType::class, $object); } #[Test] @@ -169,7 +165,7 @@ public function nameBasedFactoryToButton() { new StreamInputSource(new MemoryInputStream('