| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  |  * Nextcloud - Tasks | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  |  * @author Julius Härtl | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  |  * @copyright 2016 Julius Härtl <[email protected]> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  |  * @author Raimund Schlüßler | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  |  * @copyright 2019 Raimund Schlüßler <[email protected]> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  |  * This library is free software; you can redistribute it and/or | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  |  * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  |  * License as published by the Free Software Foundation; either | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  |  * version 3 of the License, or any later version. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 16 |  |  |  * This library is distributed in the hope that it will be useful, | 
            
                                                                                                            
                            
            
                                    
            
            
                | 17 |  |  |  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
            
                                                                                                            
                            
            
                                    
            
            
                | 18 |  |  |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
            
                                                                                                            
                            
            
                                    
            
            
                | 19 |  |  |  * GNU AFFERO GENERAL PUBLIC LICENSE for more details. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 21 |  |  |  * You should have received a copy of the GNU Affero General Public | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  |  * License along with this library.  If not, see <http://www.gnu.org/licenses/>. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  | use PHPUnit\Framework\TestCase; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 |  |  | class AppTest extends TestCase { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 |  |  | 	private $container; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 |  |  | 	private $app; | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 31 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 32 |  |  | 	public function setUp(): void { | 
            
                                                                        
                            
            
                                    
            
            
                | 33 |  |  | 		parent::setUp(); | 
            
                                                                        
                            
            
                                    
            
            
                | 34 |  |  | 		$this->app = new \OCA\Tasks\AppInfo\Application(); | 
            
                                                                        
                            
            
                                    
            
            
                | 35 |  |  | 		$this->container = $this->app->getContainer(); | 
            
                                                                        
                            
            
                                    
            
            
                | 36 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 |  |  | 	public function testAppInstalled() { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 |  |  | 		$appManager = $this->container->query('OCP\App\IAppManager'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 |  |  | 		$this->assertTrue($appManager->isInstalled('tasks')); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 |  |  | 	} | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 |  |  | 	public function testNavigation() { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 |  |  | 		$navigationManager = \OC::$server->getNavigationManager(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 |  |  | 		$navigationManager->clear(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 46 |  |  | 		$enabled = array_key_exists('tasks', $navigationManager->getAll()); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 |  |  | 		$this->assertTrue($enabled); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 48 |  |  | 	} | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 49 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 50 |  |  |  |