Refactored other PHPUnit method calls to work with namespaced PHPUnit 6
This commit is contained in:
parent
13fff761a7
commit
dbe8898644
@ -227,7 +227,12 @@ class FormPassTest extends TestCase
|
||||
$container->setDefinition('form.extension', $extDefinition);
|
||||
$container->register($id, 'stdClass')->setPublic(false)->addTag($tagName);
|
||||
|
||||
$this->setExpectedException('\InvalidArgumentException', $expectedExceptionMessage);
|
||||
if (method_exists($this, 'expectException')) {
|
||||
$this->expectException('\InvalidArgumentException');
|
||||
$this->expectExceptionMessage($expectedExceptionMessage);
|
||||
} else {
|
||||
$this->setExpectedException('\InvalidArgumentException', $expectedExceptionMessage);
|
||||
}
|
||||
|
||||
$container->compile();
|
||||
}
|
||||
|
@ -55,7 +55,12 @@ class ArrayNodeTest extends TestCase
|
||||
public function testIgnoreAndRemoveBehaviors($ignore, $remove, $expected, $message = '')
|
||||
{
|
||||
if ($expected instanceof \Exception) {
|
||||
$this->setExpectedException(get_class($expected), $expected->getMessage());
|
||||
if (method_exists($this, 'expectException')) {
|
||||
$this->expectException(get_class($expected));
|
||||
$this->expectExceptionMessage($expected->getMessage());
|
||||
} else {
|
||||
$this->setExpectedException(get_class($expected), $expected->getMessage());
|
||||
}
|
||||
}
|
||||
$node = new ArrayNode('root');
|
||||
$node->setIgnoreExtraKeys($ignore, $remove);
|
||||
|
@ -2424,6 +2424,8 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
|
||||
// compare plain HTML to check the whitespace
|
||||
try {
|
||||
$this->assertSame('<input type="text" id="text" name="text" readonly="readonly" disabled="disabled" required="required" maxlength="10" pattern="\d+" class="foobar" data-foo="bar" value="value" />', $html);
|
||||
} catch (\PHPUnit\Framework\AssertionFailedError $e) {
|
||||
$this->assertSame('<input type="text" id="text" name="text" disabled="disabled" required="required" readonly="readonly" maxlength="10" pattern="\d+" class="foobar" data-foo="bar" value="value" />', $html);
|
||||
} catch (\PHPUnit_Framework_AssertionFailedError $e) {
|
||||
$this->assertSame('<input type="text" id="text" name="text" disabled="disabled" required="required" readonly="readonly" maxlength="10" pattern="\d+" class="foobar" data-foo="bar" value="value" />', $html);
|
||||
}
|
||||
|
@ -20,7 +20,11 @@ class TranslationFilesTest extends TestCase
|
||||
*/
|
||||
public function testTranslationFileIsValid($filePath)
|
||||
{
|
||||
\PHPUnit_Util_XML::loadfile($filePath, false, false, true);
|
||||
if (class_exists('PHPUnit_Util_XML')) {
|
||||
\PHPUnit_Util_XML::loadfile($filePath, false, false, true);
|
||||
} else {
|
||||
\PHPUnit\Util\XML::loadfile($filePath, false, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
public function provideTranslationFiles()
|
||||
|
Reference in New Issue
Block a user