File tree Expand file tree Collapse file tree 2 files changed +10
-13
lines changed
src/Symfony/Component/Validator/Tests/Mapping/Loader Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Original file line number Diff line number Diff line change 4
4
5
5
use Symfony \Component \Validator \Mapping \ClassMetadata ;
6
6
7
- abstract class AbstractMethodStaticLoader
7
+ abstract class AbstractStaticMethodLoader
8
8
{
9
9
abstract public static function loadMetadata (ClassMetadata $ metadata );
10
10
}
Original file line number Diff line number Diff line change @@ -90,22 +90,19 @@ public function testLoadClassMetadataInAbstractClasses()
90
90
91
91
public function testLoadClassMetadataIgnoresAbstractMethods ()
92
92
{
93
- error_reporting (E_ALL | E_STRICT );
93
+ // Disable error reporting, as AbstractStaticMethodLoader produces a
94
+ // strict standards error
95
+ error_reporting (0 );
94
96
95
- $ loader = new StaticMethodLoader ('loadMetadata ' );
96
- $ caught = false ;
97
- try {
98
- include __DIR__ .'/AbstractMethodStaticLoader.php ' ;
99
- } catch (\Exception $ e ) {
100
- // catching the PHP notice that is converted to an exception by PHPUnit
101
- $ caught = true ;
97
+ if (0 !== error_reporting ()) {
98
+ $ this ->markTestSkipped ('Could not disable error reporting ' );
102
99
}
103
100
104
- if (!$ caught ) {
105
- $ this ->fail ('AbstractMethodStaticLoader should produce a strict standard error. ' );
106
- }
101
+ include __DIR__ .'/AbstractStaticMethodLoader.php ' ;
107
102
108
- $ metadata = new ClassMetadata (__NAMESPACE__ .'\AbstractMethodStaticLoader ' );
103
+ $ metadata = new ClassMetadata (__NAMESPACE__ .'\AbstractStaticMethodLoader ' );
104
+
105
+ $ loader = new StaticMethodLoader ('loadMetadata ' );
109
106
$ loader ->loadClassMetadata ($ metadata );
110
107
111
108
$ this ->assertCount (0 , $ metadata ->getConstraints ());
You can’t perform that action at this time.
0 commit comments