cal = new VCalendar(); $this->mockTaskCalEvent = $this->createMock(iCalEventProcessor::class); $this->cal->add('VTODO', [ "UID" => "1ff0313e-1ffa-4a18-b8c1-449bddc9109c", ], false); } function testCreateSimpleTask() { $this->server = new Server(); $this->mockTaskCalEvent->expects($this->once()) ->method('importTask') ->with($this->cal->VTODO); $this->plugin = new Plugin($this->mockTaskCalEvent); $this->plugin->initialize($this->server); $this->plugin->processCalendarEventForTaskwarrior($this->cal); } /* * TODO Need to figure out why it is not throwing the correct Exception function testBadRequest(){ $expectedBadRequestMessage = 'This was a bad request'; $this->server = new Server(); $this->cal = new VCalendar(); $this->mockTaskCalEvent->expects($this->once()) ->method('buildVEVENTForTW') ->with($this->cal->VEVENT); $this->mockTaskCalEvent ->method('buildVTODOForTW') ->with($this->throwException(new BadRequest)); $this->plugin = new Plugin($this->mockTaskCalEvent); $this->plugin->initialize($this->server); try { $this->plugin->processCalendarEventForTaskwarrior($this->cal); } catch(BadRequest $e){ $this->assertInstanceOf(BadRequest::class, $e); } } */ } ?>