41 lines
		
	
	
		
			860 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
		
			860 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php 
 | |
| 
 | |
| use Sabre\VObject;
 | |
| use Aerex\Taskwarrior;
 | |
| use DateTime;
 | |
| use DateTimeZone;
 | |
| 
 | |
| 
 | |
| class PluginTest extends \PHPUnit\Framework\TestCase {
 | |
|   
 | |
|   protected $cal;
 | |
|   protected $pluginInstance;
 | |
| 
 | |
|   function setup(){
 | |
|     $this->$cal = new Componet\VCalendar();
 | |
|     $pluginInstance = new Plugin();
 | |
| 
 | |
|   }
 | |
| 
 | |
|   function testCreateSimpleTask() {
 | |
|     $expectedTaskDescription = "Going to the Movies";
 | |
|     $expectedStartTime = new \DateTime("2018-03-13 09:33:00Z");
 | |
|     $expectedEndTime = new \DateTime("2018-03-13 10:45:00Z");
 | |
| 
 | |
|     $vCalendarObjectEvent = $this->$cal->add('VEVENT', [
 | |
|       "UID" => "1ff0313e-1ffa-4a18-b8c1-449bddc9109c",
 | |
|       "SUMMARY" => $expectedTaskDescription,
 | |
|       "DTSTART" => $expectedStartTime,
 | |
|       "DTEND" => $expectedEndTime
 | |
|     ], false);
 | |
| 
 | |
| 
 | |
|     $this->$pluginInstance->processCalendarEventForTaskwarrior($vCalendarObjectEvent);
 | |
| 
 | |
|   }
 | |
| 
 | |
| 
 | |
| }
 | |
| 
 | |
| ?>
 |