File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ abstract class TransformerAbstract
38
38
/**
39
39
* The transformer should know about the current scope, so we can fetch relevant params.
40
40
*/
41
- protected ?Scope $ currentScope ;
41
+ protected ?Scope $ currentScope = null ;
42
42
43
43
/**
44
44
* Getter for availableIncludes.
Original file line number Diff line number Diff line change @@ -74,6 +74,16 @@ public function testGetCurrentScope()
74
74
$ this ->assertSame ($ transformer ->getCurrentScope (), $ scope );
75
75
}
76
76
77
+ /**
78
+ * @covers \League\Fractal\TransformerAbstract::getCurrentScope
79
+ */
80
+ public function testCanAccessScopeBeforeInitialization ()
81
+ {
82
+ $ transformer = $ this ->getMockForAbstractClass ('League\Fractal\TransformerAbstract ' );
83
+ $ currentScope = $ transformer ->getCurrentScope ();
84
+ $ this ->assertNull ($ currentScope );
85
+ }
86
+
77
87
public function testProcessEmbeddedResourcesNoAvailableIncludes ()
78
88
{
79
89
$ transformer = m::mock ('League\Fractal\TransformerAbstract ' )->makePartial ();
You can’t perform that action at this time.
0 commit comments