visitor = new RecordingVisitor(); } public function provideRoles() { return [ [new User('Dominik')], [new Group('Administrators')], ]; } /** * @dataProvider provideRoles */ public function testVisitSomeRole(Role $role) { $role->accept($this->visitor); $this->assertSame($role, $this->visitor->getVisited()[0]); } }