/**
  * @param \Cms\Dao\WebsiteSettings\Filesystem|null $daoFilesystem
  * @param \Cms\Dao\WebsiteSettings\Doctrine|null $daoDoctrine
  *
  * @return AllReadonlyDao
  */
 protected function getAllDao($daoFilesystem = null, $daoDoctrine = null)
 {
     $allDao = new AllReadonlyDao();
     if (!is_null($daoDoctrine)) {
         $allDao->phpunit_setDoctrineDao($daoDoctrine);
     }
     if (!is_null($daoFilesystem)) {
         $allDao->phpunit_setFilesystemDao($daoFilesystem);
     }
     return $allDao;
 }
Exemple #2
0
 public static function tearDown()
 {
     DaoFactory::reset();
     foreach (self::getActiveMocks() as $mockName => $mockData) {
         $mockState = isset($mockData['state']) ? $mockData['state'] : $mockData;
         switch ($mockName . '-' . $mockState) {
             case 'Module-readable':
                 ModuleReadonlyMock::tearDown();
                 break;
             case 'Module-writeable':
                 ModuleWriteableMock::tearDown();
                 break;
             case 'Website-readable':
                 WebsiteReadonlyMock::tearDown();
                 break;
             case 'Website-writeable':
                 WebsiteWriteableMock::tearDown();
                 break;
             case 'Page-readable':
                 PageReadonlyMock::tearDown();
                 break;
             case 'Page-writeable':
                 PageWriteableMock::tearDown();
                 break;
             case 'Package-readable':
                 PackageReadonlyMock::tearDown();
                 break;
             case 'Package-writeable':
                 PackageWriteableMock::tearDown();
                 break;
             case 'WebsiteSettings-readable':
                 WebsiteSettingsReadonlyMock::tearDown();
                 break;
             case 'WebsiteSettings-writeable':
                 WebsiteSettingsWriteableMock::tearDown();
                 break;
             case 'PageType-readable':
                 PageTypeReadonlyMock::tearDown();
                 break;
             case 'PageType-writeable':
                 PageTypeWriteableMock::tearDown();
                 break;
         }
     }
     self::$activatedMocks = array();
 }