1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

fix risky tests (without any assertion)

This commit is contained in:
Ion Bazan 2020-02-07 14:35:07 +08:00
parent db32d6bc18
commit 58b34d13e8
11 changed files with 33 additions and 16 deletions

View file

@ -20,6 +20,16 @@ use Composer\Test\TestCase;
*/
class ErrorHandlerTest extends TestCase
{
public function setUp()
{
ErrorHandler::register();
}
public function tearDown()
{
restore_error_handler();
}
/**
* Test ErrorHandler handles notices
*/
@ -27,8 +37,6 @@ class ErrorHandlerTest extends TestCase
{
$this->setExpectedException('\ErrorException', 'Undefined index: baz');
ErrorHandler::register();
$array = array('foo' => 'bar');
$array['baz'];
}
@ -40,18 +48,15 @@ class ErrorHandlerTest extends TestCase
{
$this->setExpectedException('\ErrorException', 'array_merge');
ErrorHandler::register();
array_merge(array(), 'string');
}
/**
* Test ErrorHandler handles warnings
* @doesNotPerformAssertions
*/
public function testErrorHandlerRespectsAtOperator()
{
ErrorHandler::register();
@trigger_error('test', E_USER_NOTICE);
}
}