Skip to content

Commit

Permalink
Udating tests after chaing the accessible properties in Entity
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Mar 16, 2014
1 parent a3eb624 commit 5791174
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/TestCase/ORM/EntityTest.php
Expand Up @@ -937,6 +937,7 @@ public function testAccessibleWildcard() {
public function testSetWithAccessible() {
$entity = new Entity(['foo' => 1, 'bar' => 2]);
$options = ['guard' => true];
$entity->accessible('*', false);
$entity->accessible('foo', true);
$entity->set('bar', 3, $options);
$entity->set('foo', 4, $options);
Expand All @@ -956,6 +957,7 @@ public function testSetWithAccessible() {
public function testSetWithAccessibleWithArray() {
$entity = new Entity(['foo' => 1, 'bar' => 2]);
$options = ['guard' => true];
$entity->accessible('*', false);
$entity->accessible('foo', true);
$entity->set(['bar' => 3, 'foo' => 4], $options);
$this->assertEquals(2, $entity->get('bar'));
Expand All @@ -974,6 +976,7 @@ public function testSetWithAccessibleWithArray() {
*/
public function testSetWithAccessibleSingleProperty() {
$entity = new Entity(['foo' => 1, 'bar' => 2]);
$entity->accessible('*', false);
$entity->accessible('title', true);

$entity->set(['title' => 'test', 'body' => 'Nope']);
Expand Down
1 change: 1 addition & 0 deletions tests/TestCase/ORM/MarshallerTest.php
Expand Up @@ -525,6 +525,7 @@ public function testMergeWhitelist() {
'title' => 'Foo',
'body' => 'My Content'
]);
$entity->accessible('*', false);
$entity->accessible('author_id', true);
$entity->isNew(false);
$result = $marshall->merge($entity, $data, []);
Expand Down

0 comments on commit 5791174

Please sign in to comment.