/** * @test * @expectedException \InvalidArgumentException */ public function throws_an_exception_when_adding_a_skill_whose_name_already_exists_in_the_category() { $category = new Category(); $skill = (new Skill())->setTitle('foo'); $duplicate = (new Skill())->setTitle('foo'); $category->addSkill($skill); $category->addSkill($duplicate); }