Conditions | 1 |
Paths | 1 |
Total Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
10 | public function testBasics() |
||
11 | { |
||
12 | $context = $this->get(Context::class); |
||
13 | |||
14 | $this->assertSame($context, $this->actAs(1)); |
||
15 | $this->assertSame($context->person, 1); |
||
16 | $this->assertSame($context->module, null); |
||
17 | |||
18 | $this->assertSame($context, $this->actAs(2)); |
||
19 | $this->assertSame($context->person, 2); |
||
20 | $this->assertSame($context->module, null); |
||
21 | |||
22 | // configured context |
||
23 | $this->actAs(['person' => 3, 'module' => 1 ]); |
||
24 | $this->assertSame($context->person, 3); |
||
25 | $this->assertSame($context->module, 1); |
||
26 | |||
27 | // context reset on actor reconfigure |
||
28 | $this->actAs(4); |
||
29 | $this->assertSame($context->person, 4); |
||
30 | $this->assertSame($context->module, null); |
||
31 | } |
||
32 | } |
||
33 |