コード例 #1
0
ファイル: EntityTest.php プロジェクト: jeremyheaton/ultiswap
 /**
  * Tests __debugInfo
  *
  * @return void
  */
 public function testDebugInfo()
 {
     $entity = new Entity(['foo' => 'bar'], ['markClean' => true]);
     $entity->somethingElse = 'value';
     $entity->accessible('name', true);
     $entity->virtualProperties(['baz']);
     $entity->dirty('foo', true);
     $entity->errors('foo', ['An error']);
     $entity->source('foos');
     $result = $entity->__debugInfo();
     $expected = ['foo' => 'bar', 'somethingElse' => 'value', '[new]' => true, '[accessible]' => ['*' => true, 'name' => true], '[dirty]' => ['somethingElse' => true, 'foo' => true], '[original]' => [], '[virtual]' => ['baz'], '[errors]' => ['foo' => ['An error']], '[repository]' => 'foos'];
     $this->assertSame($expected, $result);
 }
コード例 #2
0
ファイル: EntityTest.php プロジェクト: RogerSchmeier/Webtruck
 /**
  * Tests __debugInfo
  *
  * @return void
  */
 public function testDebugInfo()
 {
     $entity = new Entity(['foo' => 'bar'], ['markClean' => true]);
     $entity->accessible('name', true);
     $entity->virtualProperties(['baz']);
     $entity->dirty('foo', true);
     $entity->errors('foo', ['An error']);
     $entity->source('foos');
     $result = $entity->__debugInfo();
     $expected = ['new' => true, 'accessible' => ['*' => true, 'name' => true], 'properties' => ['foo' => 'bar'], 'dirty' => ['foo' => true], 'original' => [], 'virtual' => ['baz'], 'errors' => ['foo' => ['An error']], 'repository' => 'foos'];
     $this->assertSame($expected, $result);
 }