/** * Constructor. * * @param string $name * @param mixed $subject * @param array $args */ public function __construct($name, $subject, array $args) { $this->name = $name; $this->subject = $subject; $this->params = new Data(array_keys($args)); $this->params->load($args); }
public function testToArray_returnsArray() { $this->subject->load(['offset1' => '']); $this->subject['offset3']['offset1'] = 1; $this->subject['offset3']['offset2'] = ''; $this->subject['offset3']['offset3'] = 'test'; $expected = ['offset1' => 'filtrated', 'offset2' => null, 'offset3' => ['offset1' => 1, 'offset2' => '', 'offset3' => 'test'], 'offset4' => ['offset1' => null, 'offset2' => null, 'offset3' => null]]; $this->assertSame($expected, $this->subject->toArray()); }