1
0
mirror of synced 2024-12-13 22:56:04 +03:00

Fixed failing tests in PHPUnit 3.6.2 (expecting \Exception was deprecated)

This commit is contained in:
Alexander 2011-11-09 08:17:46 +01:00
parent d532de9da3
commit 2ddfc6af5a
2 changed files with 19 additions and 5 deletions

View File

@ -73,7 +73,14 @@ class OneToManyUnidirectionalAssociationTest extends \Doctrine\Tests\OrmFunction
$this->_em->persist($routeA);
$this->_em->persist($routeB);
$this->setExpectedException('Exception'); // depends on the underyling Database Driver
$this->_em->flush(); // Exception
$exceptionThrown = false;
try {
// exception depending on the underyling Database Driver
$this->_em->flush();
} catch(\Exception $e) {
$exceptionThrown = true;
}
$this->assertTrue($exceptionThrown, "The underlying database driver throws an exception.");
}
}
}

View File

@ -209,8 +209,15 @@ class DDC117Test extends \Doctrine\Tests\OrmFunctionalTestCase
$this->article1->addTranslation('en', 'Bar');
$this->article1->addTranslation('en', 'Baz');
$this->setExpectedException('Exception');
$this->_em->flush();
$exceptionThrown = false;
try {
// exception depending on the underyling Database Driver
$this->_em->flush();
} catch(\Exception $e) {
$exceptionThrown = true;
}
$this->assertTrue($exceptionThrown, "The underlying database driver throws an exception.");
}
/**