minor #10819 Fix a test that was ambiguous (fabpot)
This PR was merged into the 2.3 branch.
Discussion
----------
Fix a test that was ambiguous
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | see #9634 for a discussion of this and #9383 for the report
| License | MIT
| Doc PR | n/a
This PR fixes a test that was always passing as the exception catch was catching the PHP notice but also the exception sent by `fail`, so it was useless. That said, I'm not even convinced that this test is useful at all.
Commits
-------
a94b4e0
[Validator] fixed wrong test
This commit is contained in:
commit
d1267cb2d7
@ -79,10 +79,16 @@ class StaticMethodLoaderTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function testLoadClassMetadataIgnoresAbstractMethods()
|
public function testLoadClassMetadataIgnoresAbstractMethods()
|
||||||
{
|
{
|
||||||
$loader = new StaticMethodLoader('loadMetadata');
|
$loader = new StaticMethodLoader('loadMetadata');
|
||||||
|
$caught = false;
|
||||||
try {
|
try {
|
||||||
include __DIR__.'/AbstractMethodStaticLoader.php';
|
include __DIR__.'/AbstractMethodStaticLoader.php';
|
||||||
$this->fail('AbstractMethodStaticLoader should produce a strict standard error.');
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
// catching the PHP notice that is converted to an exception by PHPUnit
|
||||||
|
$caught = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$caught) {
|
||||||
|
$this->fail('AbstractMethodStaticLoader should produce a strict standard error.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$metadata = new ClassMetadata(__NAMESPACE__.'\AbstractMethodStaticLoader');
|
$metadata = new ClassMetadata(__NAMESPACE__.'\AbstractMethodStaticLoader');
|
||||||
|
Reference in New Issue
Block a user