Skip to content

Commit 5c38eef

Browse files
committed
[Validator] fixed wrong test
1 parent a9fae55 commit 5c38eef

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Tests/Mapping/Loader/StaticMethodLoaderTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,16 @@ public function testLoadClassMetadataInAbstractClasses()
7979
public function testLoadClassMetadataIgnoresAbstractMethods()
8080
{
8181
$loader = new StaticMethodLoader('loadMetadata');
82+
$caught = false;
8283
try {
83-
include __DIR__ . '/AbstractMethodStaticLoader.php';
84-
$this->fail('AbstractMethodStaticLoader should produce a strict standard error.');
84+
include __DIR__.'/AbstractMethodStaticLoader.php';
8585
} catch (\Exception $e) {
86+
// catching the PHP notice that is converted to an exception by PHPUnit
87+
$caught = true;
88+
}
89+
90+
if (!$caught) {
91+
$this->fail('AbstractMethodStaticLoader should produce a strict standard error.');
8692
}
8793

8894
$metadata = new ClassMetadata(__NAMESPACE__.'\AbstractMethodStaticLoader');

0 commit comments

Comments
 (0)