예제 #1
0
파일: Event.php 프로젝트: neatphp/neat
 /**
  * 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);
 }
예제 #2
0
파일: DataTest.php 프로젝트: neatphp/neat
 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());
 }