mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Update exception assertions in tests and remove deprecated annotations
This commit is contained in:
parent
27bd5d12e3
commit
ae1e17edec
@ -432,7 +432,7 @@ abstract class Database
|
||||
|
||||
default:
|
||||
throw new \InvalidArgumentException(
|
||||
"SS_Database::manipulate() Can't recognise command '{$writeInfo['command']}'",
|
||||
"SS_Database::manipulate() Can't recognise command '{$writeInfo['command']}'"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -160,11 +160,9 @@ class HTTPRequestTest extends SapphireTest
|
||||
$this->assertEquals($expected, $actual);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException PHPUnit_Framework_Error
|
||||
*/
|
||||
public function testBadDetectMethod()
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
HTTPRequest::detect_method('POST', ['_method' => 'Boom']);
|
||||
}
|
||||
|
||||
@ -191,11 +189,9 @@ class HTTPRequestTest extends SapphireTest
|
||||
$this->assertEquals($request, $returnedRequest);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException PHPUnit_Framework_Error
|
||||
*/
|
||||
public function testBadSetHttpMethod()
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$request = new HTTPRequest('GET', '/hello');
|
||||
$request->setHttpMethod('boom');
|
||||
}
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
namespace SilverStripe\Forms\Tests;
|
||||
|
||||
use PHPUnit_Framework_Error;
|
||||
use SilverStripe\Dev\CSSContentParser;
|
||||
use SilverStripe\Dev\SapphireTest;
|
||||
use SilverStripe\Forms\CompositeField;
|
||||
@ -161,12 +160,13 @@ class CompositeFieldTest extends SapphireTest
|
||||
$this->assertNull($result['title']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException PHPUnit_Framework_Error
|
||||
* @expectedExceptionMessageRegExp /a field called 'Test' appears twice in your form.*TextField.*TextField/
|
||||
*/
|
||||
public function testCollateDataFieldsThrowsErrorOnDuplicateChildren()
|
||||
{
|
||||
$this->expectException(\RuntimeException::class);
|
||||
$this->expectExceptionMessageRegExp(
|
||||
"/a field called 'Test' appears twice in your form.*TextField.*TextField/"
|
||||
);
|
||||
|
||||
$field = CompositeField::create(
|
||||
TextField::create('Test'),
|
||||
TextField::create('Test')
|
||||
|
Loading…
Reference in New Issue
Block a user