Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
feat(test): add tests to taskstatus
Browse files Browse the repository at this point in the history
add testUpdateStatus method
add testPrepareInputForUpdate method

Signed-off-by: Luis F. Gonzalez <lgonzalez@teclib.com>
  • Loading branch information
ingluife authored and DIOHz0r committed Aug 17, 2018
1 parent de9501f commit 6c1ffcb
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/suite-unit/PluginFlyvemdmTaskstatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,29 @@ public function testGetTypeName() {
$instance = $this->createInstance();
$this->string($instance->getTypeName())->isEqualTo('Task status');
}

/**
* @tags testUpdateStatus
*/
public function testUpdateStatus() {
$class = $this->testedClass->getClass();
$instance = $this->createInstance();
list($policy) = $class->createNewPolicyInstance();
$status = $policy->filterStatus("pending");
$this->notNull($status);
$instance->update([
'id' => $instance->getID(),
'status' => $status,
]);
$this->string($status)->isEqualTo($instance->getField('status'));
}

/**
* @tags testPrepareInputForUpdate
*/
public function testPrepareInputForUpdate() {
$instance = $this->createInstance();
$this->array($instance->prepareInputForUpdate([]));
}

}

0 comments on commit 6c1ffcb

Please sign in to comment.