Skip to content

Commit

Permalink
Unit Test unset Rule.
Browse files Browse the repository at this point in the history
  • Loading branch information
francis94c committed Sep 18, 2019
1 parent cbeadc2 commit e0bd913
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions phpunit/RefactorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,28 @@ public function testLoadPackage():void {
self::$ci->load->package(self::PACKAGE);
$this->assertTrue(isset(self::$ci->refactor));
}
/**
* [testDirectUnsetRule description]
*
* @depends testLoadPackage
*/
public function testDirectUnsetRule():void {
$payload = [
'name' => 'collins',
'pc_brand' => 'HP',
'phone' => '+2349086756453',
'school' => 'Delloite',
'company' => 'Google'
];
$rule = [
'unset' => [
'school',
'phone'
]
];
self::$ci->refactor->run($payload, $rule);
$this->assertFalse(isset($payload['school']));
$this->assertFalse(isset($payload['phone']));
$this->assertTrue(isset($payload['company']));
}
}

0 comments on commit e0bd913

Please sign in to comment.