1
0
Fork 0

Todos can now be important

This commit is contained in:
Marcel Kapfer 2021-09-20 11:27:46 +02:00
parent f723e0e8c4
commit c881154db7
Signed by: mmk2410
GPG key ID: CADE6F0C09F21B09
2 changed files with 37 additions and 6 deletions

View file

@ -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"
);
}
}