Skip to content

Commit

Permalink
Merge pull request #217 from symfony-cmf/analysis-6VQeKW
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
dbu committed Feb 16, 2024
2 parents 504f9ab + ec7c793 commit 3d1abbe
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/Functional/BaseTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ protected static function assertResponseSuccess(Response $response)
{
libxml_use_internal_errors(true);

$dom = new \DomDocument();
$dom = new \DOMDocument();
$dom->loadHTML($response->getContent());

$xpath = new \DOMXpath($dom);
$xpath = new \DOMXPath($dom);
$result = $xpath->query('//div[contains(@class,"text-exception")]/h1');
$exception = null;
if ($result->length) {
Expand Down
2 changes: 1 addition & 1 deletion src/Unit/Constraint/SchemaAcceptsXml.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function matches($schemaFile): bool
throw new \InvalidArgumentException(sprintf('Can only test a file if it contains 1 <config> element, %d given', $configElement->length));
}

$configDom = new \DomDocument();
$configDom = new \DOMDocument();
$configDom->appendChild($configDom->importNode($configElement->item(0), true));

libxml_use_internal_errors(true);
Expand Down
1 change: 1 addition & 0 deletions tests/Functional/BaseTestCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public function provideTestDb()

/**
* @dataProvider provideTestDb
*
* @depends testGetContainer
*/
public function testDb($dbName, $expected)
Expand Down
6 changes: 3 additions & 3 deletions tests/Unit/Constraint/SchemaAcceptsXmlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ public function getAssertingData()

$data = [];

$dom1 = new \DomDocument();
$dom1 = new \DOMDocument();
$dom1->loadXML('<container><config xmlns="http://cmf.symfony.com/schema/dic/foo" required="f"/></container>');
$data[] = [[$dom1], $schema1, true];

$dom2 = new \DomDocument();
$dom2 = new \DOMDocument();
$dom2->loadXML('<container><config xmlns="http://cmf.symfony.com/schema/dic/foo" /></container>');
$data[] = [[$dom2], $schema1, false];

Expand All @@ -70,7 +70,7 @@ public function getAssertingData()

public function testFailsIfNoConfigElementIsAvailable()
{
$dom = new \DomDocument();
$dom = new \DOMDocument();
$dom->loadXML('<container></container>');

$constraint = new SchemaAcceptsXml([$dom]);
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/XmlSchemaTestCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ class XmlSchemaTestCaseTest extends XmlSchemaTestCase
{
public function testAcceptsSingleDomsWithoutArray()
{
$dom = new \DomDocument();
$dom = new \DOMDocument();
$dom->loadXML('<container><config xmlns="http://cmf.symfony.com/schema/dic/foo" required="f"/></container>');
$this->assertSchemaAcceptsXml($dom, __DIR__.'/../Fixtures/schema/schema1.xsd');
}

public function testNegativeAssertion()
{
$dom = new \DomDocument();
$dom = new \DOMDocument();
$dom->loadXML('<container><config xmlns="http://cmf.symfony.com/schema/dic/foo" /></container>');

$this->assertSchemaRefusesXml($dom, __DIR__.'/../Fixtures/schema/schema1.xsd');
Expand Down

0 comments on commit 3d1abbe

Please sign in to comment.