Skip to content

Commit

Permalink
Merge pull request #1934 from divine/pr_1468
Browse files Browse the repository at this point in the history
[Updated PR#1468] Fix assertObjectNotHasAttribute cannot test magic attributes
  • Loading branch information
Smolevich committed Jan 30, 2020
2 parents 5cf5816 + a2425c5 commit 2efa5af
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/ModelTest.php
Expand Up @@ -361,7 +361,7 @@ public function testUnset(): void

$user1->unset('note1');

$this->assertObjectNotHasAttribute('note1', $user1);
$this->assertFalse(isset($user1->note1));
$this->assertTrue(isset($user1->note2));
$this->assertTrue(isset($user2->note1));
$this->assertTrue(isset($user2->note2));
Expand All @@ -370,15 +370,15 @@ public function testUnset(): void
$user1 = User::find($user1->_id);
$user2 = User::find($user2->_id);

$this->assertObjectNotHasAttribute('note1', $user1);
$this->assertFalse(isset($user1->note1));
$this->assertTrue(isset($user1->note2));
$this->assertTrue(isset($user2->note1));
$this->assertTrue(isset($user2->note2));

$user2->unset(['note1', 'note2']);

$this->assertObjectNotHasAttribute('note1', $user2);
$this->assertObjectNotHasAttribute('note2', $user2);
$this->assertFalse(isset($user2->note1));
$this->assertFalse(isset($user2->note2));
}

public function testDates(): void
Expand Down

0 comments on commit 2efa5af

Please sign in to comment.