Todos can now be important
This commit is contained in:
parent
f723e0e8c4
commit
c881154db7
2 changed files with 37 additions and 6 deletions
|
@ -19,7 +19,7 @@ class TodoTest extends TestCase
|
|||
|
||||
public function testDontCreateEmptyTodo(): void
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectException(InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage(Todo::ExceptionMsgInvalidTitle);
|
||||
new Todo("");
|
||||
}
|
||||
|
@ -60,8 +60,26 @@ class TodoTest extends TestCase
|
|||
public function testSetBogusTodoState(): void
|
||||
{
|
||||
$todo = new Todo("stub");
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectException(InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage(Todo::ExceptionMsgInvalidState);
|
||||
$todo->setState("bogus");
|
||||
}
|
||||
|
||||
public function testCreateImportantTodo(): void
|
||||
{
|
||||
$todo = new Todo("Some title", true);
|
||||
$this->assertTrue(
|
||||
$todo->getImportant(),
|
||||
"Todo created as important, but it is not"
|
||||
);
|
||||
}
|
||||
|
||||
public function testMakeTodoImportant(): void {
|
||||
$todo = new Todo("Some title");
|
||||
$todo->setImportant();
|
||||
$this->assertTrue(
|
||||
$todo->getImportant(),
|
||||
"Todo changed to important, but it is not"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue