|
|
@@ -1005,16 +1005,39 @@ class EntityTest extends TestCase {
|
|
|
$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([
|
|
|
+ 'alias' => 'foos',
|
|
|
+ 'className' => 'Something'
|
|
|
+ ]);
|
|
|
$result = $entity->__debugInfo();
|
|
|
$expected = [
|
|
|
- 'new' => true,
|
|
|
- 'accessible' => ['name'],
|
|
|
+ 'new' => null,
|
|
|
+ 'accessible' => ['name' => true],
|
|
|
'properties' => ['foo' => 'bar'],
|
|
|
'dirty' => ['foo' => true],
|
|
|
'virtual' => ['baz'],
|
|
|
- 'errors' => ['foo' => ['An error']]
|
|
|
+ 'errors' => ['foo' => ['An error']],
|
|
|
+ 'repository' => [
|
|
|
+ 'alias' => 'foos',
|
|
|
+ 'className' => 'Something'
|
|
|
+ ]
|
|
|
];
|
|
|
+ $this->assertSame($expected, $result);
|
|
|
+ }
|
|
|
+
|
|
|
+/**
|
|
|
+ * Tests the source method
|
|
|
+ *
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function testSource() {
|
|
|
+ $entity = new Entity;
|
|
|
+ $this->assertEquals([], $entity->source());
|
|
|
+ $source = ['alias' => 'foo', 'className' => 'bar'];
|
|
|
+ $entity->source($source);
|
|
|
+ $this->assertEquals($source, $entity->source());
|
|
|
}
|
|
|
|
|
|
}
|