|
12 | 12 |
|
13 | 13 | namespace CloudCreativity\Modules\Tests\Unit\Toolkit\Loggable; |
14 | 14 |
|
| 15 | +use CloudCreativity\Modules\Contracts\Toolkit\Loggable\ContextProvider; |
15 | 16 | use CloudCreativity\Modules\Contracts\Toolkit\Messages\Message; |
16 | 17 | use CloudCreativity\Modules\Toolkit\Loggable\ObjectDecorator; |
17 | 18 | use CloudCreativity\Modules\Toolkit\Loggable\Sensitive; |
@@ -61,11 +62,13 @@ public function testItUsesObjectProperties(): void |
61 | 62 | 'blah' => null, |
62 | 63 | ]; |
63 | 64 |
|
64 | | - $iterator = new ObjectDecorator($source); |
| 65 | + $decorator = new ObjectDecorator($source); |
65 | 66 |
|
66 | | - $this->assertSame(array_keys($expected), $iterator->keys()); |
67 | | - $this->assertSame($expected, iterator_to_array($iterator)); |
68 | | - $this->assertSame($expected, $iterator->all()); |
| 67 | + $this->assertInstanceOf(ContextProvider::class, $decorator); |
| 68 | + $this->assertSame(array_keys($expected), $decorator->keys()); |
| 69 | + $this->assertSame($expected, iterator_to_array($decorator)); |
| 70 | + $this->assertSame($expected, $decorator->all()); |
| 71 | + $this->assertSame($expected, $decorator->context()); |
69 | 72 | $this->assertSame($expected, $this->factory->make($source)); |
70 | 73 | } |
71 | 74 |
|
@@ -93,10 +96,11 @@ public function __construct( |
93 | 96 | 'blah2' => 'World', |
94 | 97 | ]; |
95 | 98 |
|
96 | | - $iterator = new ObjectDecorator($source); |
| 99 | + $decorator = new ObjectDecorator($source); |
97 | 100 |
|
98 | | - $this->assertSame(array_keys($expected), $iterator->keys()); |
99 | | - $this->assertSame($expected, $iterator->all()); |
| 101 | + $this->assertSame(array_keys($expected), $decorator->keys()); |
| 102 | + $this->assertSame($expected, $decorator->all()); |
| 103 | + $this->assertSame($expected, $decorator->context()); |
100 | 104 | $this->assertSame($expected, $this->factory->make($source)); |
101 | 105 | } |
102 | 106 | } |
0 commit comments