當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TestCase::setUp方法代碼示例

本文整理匯總了PHP中Test\TestCase::setUp方法的典型用法代碼示例。如果您正苦於以下問題:PHP TestCase::setUp方法的具體用法?PHP TestCase::setUp怎麽用?PHP TestCase::setUp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Test\TestCase的用法示例。


在下文中一共展示了TestCase::setUp方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->tagManager = $this->getMock('\\OCP\\SystemTag\\ISystemTagManager');
     $this->tagMapper = $this->getMock('\\OCP\\SystemTag\\ISystemTagObjectMapper');
     $this->user = $this->getMock('\\OCP\\IUser');
 }
開發者ID:rchicoli,項目名稱:owncloud-core,代碼行數:7,代碼來源:SystemTagsObjectMappingCollectionTest.php

示例2: setUp

	protected function setUp() {
		parent::setUp();

		$this->connection = \OC::$server->getDatabaseConnection();
		$this->repair = new \OC\Repair\CleanTags($this->connection);
		$this->cleanUpTables();
	}
開發者ID:ninjasilicon,項目名稱:core,代碼行數:7,代碼來源:cleantags.php

示例3: setUp

 public function setUp()
 {
     parent::setUp();
     $this->session = $this->getMockBuilder('\\OCP\\ISession')->disableOriginalConstructor()->getMock();
     $this->userSession = $this->getMockBuilder('\\OCP\\IUserSession')->disableOriginalConstructor()->getMock();
     $this->auth = new \OCA\DAV\Connector\Sabre\Auth($this->session, $this->userSession);
 }
開發者ID:TechArea,項目名稱:core,代碼行數:7,代碼來源:auth.php

示例4: setUp

 protected function setUp()
 {
     parent::setUp();
     if (!function_exists('idn_to_ascii')) {
         $this->markTestSkipped('The intl extension is not available.');
     }
 }
開發者ID:riso,項目名稱:owncloud-core,代碼行數:7,代碼來源:mail.php

示例5: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->tagManager = $this->getMock('\\OCP\\SystemTag\\ISystemTagManager');
     $this->tagMapper = $this->getMock('\\OCP\\SystemTag\\ISystemTagObjectMapper');
     $this->node = new \OCA\DAV\SystemTag\SystemTagsObjectMappingCollection(111, 'files', $this->tagManager, $this->tagMapper);
 }
開發者ID:gmurayama,項目名稱:core,代碼行數:7,代碼來源:systemtagsobjectmappingcollection.php

示例6: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->appstore = OC_Config::getValue('appstoreenabled', true);
     OC_Config::setValue('appstoreenabled', true);
     OC_Installer::removeApp(self::$appid);
 }
開發者ID:evanjt,項目名稱:core,代碼行數:7,代碼來源:installer.php

示例7: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->tag = new SystemTag(1, 'Test', true, false);
     $this->tagManager = $this->getMock('\\OCP\\SystemTag\\ISystemTagManager');
     $this->node = new \OCA\DAV\SystemTag\SystemTagNode($this->tag, $this->tagManager);
 }
開發者ID:DanielTosello,項目名稱:owncloud,代碼行數:7,代碼來源:systemtagnode.php

示例8: setUp

 public function setUp()
 {
     parent::setUp();
     $this->urlGenerator = $this->getMock('OCP\\IURLGenerator');
     $this->il10n = $this->getMock('OCP\\IL10N');
     $this->addressHandler = new AddressHandler($this->urlGenerator, $this->il10n);
 }
開發者ID:rchicoli,項目名稱:owncloud-core,代碼行數:7,代碼來源:AddressHandlerTest.php

示例9: setUp

 public function setUp()
 {
     parent::setUp();
     $this->view = $this->getMockBuilder('OC\\Files\\View')->disableOriginalConstructor()->getMock();
     $this->userManager = $this->getMockBuilder('OC\\User\\Manager')->disableOriginalConstructor()->getMock();
     $this->config = $this->getMockBuilder('OCP\\IConfig')->disableOriginalConstructor()->getMock();
 }
開發者ID:adolfo2103,項目名稱:hcloudfilem,代碼行數:7,代碼來源:utiltest.php

示例10: setUp

 public function setUp()
 {
     parent::setUp();
     $this->request = $this->getMockBuilder('\\OCP\\IRequest')->disableOriginalConstructor()->getMock();
     $this->externalManager = $this->getMockBuilder('\\OCA\\Files_Sharing\\External\\Manager')->disableOriginalConstructor()->getMock();
     $this->clientService = $this->getMockBuilder('\\OCP\\Http\\Client\\IClientService')->disableOriginalConstructor()->getMock();
 }
開發者ID:GitHubUser4234,項目名稱:core,代碼行數:7,代碼來源:ExternalShareControllerTest.php

示例11: setUp

 protected function setUp()
 {
     parent::setUp();
     self::$logs = array();
     $this->config = $this->getMockBuilder('\\OC\\SystemConfig')->disableOriginalConstructor()->getMock();
     $this->logger = new Log('Test\\Logger', $this->config);
 }
開發者ID:julakali,項目名稱:core,代碼行數:7,代碼來源:logger.php

示例12: setUp

 protected function setUp()
 {
     parent::setUp();
     // remember files_encryption state
     $this->stateFilesEncryption = \OC_App::isEnabled('files_encryption');
     // we want to tests with the encryption app disabled
     \OC_App::disable('files_encryption');
     $this->storage = new \OC\Files\Storage\Temporary(array());
     $textData = "dummy file data\n";
     $imgData = file_get_contents(\OC::$SERVERROOT . '/core/img/logo.png');
     $this->storage->mkdir('folder');
     $this->storage->file_put_contents('foo.txt', $textData);
     $this->storage->file_put_contents('foo.png', $imgData);
     $this->storage->file_put_contents('folder/bar.txt', $textData);
     $this->storage->file_put_contents('folder/bar2.txt', $textData);
     $this->scanner = $this->storage->getScanner();
     $this->scanner->scan('');
     $this->cache = $this->storage->getCache();
     $this->originalStorage = Filesystem::getStorage('/');
     Filesystem::tearDown();
     if (!self::$user) {
         self::$user = $this->getUniqueID();
     }
     \OC_User::createUser(self::$user, 'password');
     \OC_User::setUserId(self::$user);
     Filesystem::init(self::$user, '/' . self::$user . '/files');
     Filesystem::clearMounts();
     Filesystem::mount($this->storage, array(), '/' . self::$user . '/files');
     \OC_Hook::clear('OC_Filesystem');
 }
開發者ID:heldernl,項目名稱:owncloud8-extended,代碼行數:30,代碼來源:updaterlegacy.php

示例13: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->originalStorage = \OC\Files\Filesystem::getStorage('/');
     \OC_User::setUserId('');
     \OC\Files\Filesystem::clearMounts();
 }
開發者ID:heldernl,項目名稱:owncloud8-extended,代碼行數:7,代碼來源:filesystem.php

示例14: setUp

	public function setUp() {
		parent::setUp();
		$this->view = $this->getMockBuilder('OC\Files\View')
			->disableOriginalConstructor()
			->getMock();

		$this->userManager = $this->getMockBuilder('OC\User\Manager')
			->disableOriginalConstructor()
			->getMock();

		$this->groupManager = $this->getMockBuilder('OC\Group\Manager')
			->disableOriginalConstructor()
			->getMock();

		$this->config = $this->getMockBuilder('OCP\IConfig')
			->disableOriginalConstructor()
			->getMock();

		$this->util = new Util(
			$this->view,
			$this->userManager,
			$this->groupManager,
			$this->config
		);

	}
開發者ID:ninjasilicon,項目名稱:core,代碼行數:26,代碼來源:utiltest.php

示例15: setUp

 public function setUp()
 {
     parent::setUp();
     $this->config = $this->getMock('\\OCP\\IConfig');
     $this->userManager = $this->getMock('\\OCP\\IUserManager');
     $this->scanFiles = $this->getMockBuilder('\\OCA\\Files\\BackgroundJob\\ScanFiles')->setConstructorArgs([$this->config, $this->userManager])->setMethods(['runScanner'])->getMock();
 }
開發者ID:gmurayama,項目名稱:core,代碼行數:7,代碼來源:ScanFilesTest.php


注:本文中的Test\TestCase::setUp方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。