当前位置: 首页>>代码示例>>PHP>>正文


PHP CakeTestCase::__construct方法代码示例

本文整理汇总了PHP中CakeTestCase::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP CakeTestCase::__construct方法的具体用法?PHP CakeTestCase::__construct怎么用?PHP CakeTestCase::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CakeTestCase的用法示例。


在下文中一共展示了CakeTestCase::__construct方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * @brief setup the test case and try catch any errors
  *
  * CakePHP just throws errors all over if there is a missing fixture.
  * Here we try and catch any errors and display them so that its easier
  * to fix.
  *
  * @access public
  *
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     if (is_subclass_of($this, 'AppControllerTestCase')) {
         try {
             $this->AppTest = new AppTest($this);
         } catch (AppTestException $e) {
             pr($e->error());
             exit;
         }
     }
 }
开发者ID:nani8124,项目名称:infinitas,代码行数:23,代码来源:AppControllerTestCase.php

示例2: __construct

 /**
  * {@inheritDoc}
  */
 public function __construct($name = null, array $data = array(), $dataName = '')
 {
     parent::__construct($name, $data, $dataName);
     // ブラウザと、コンソールでCakeRequestの内容が違うので一旦トップページとして初期化する
     Configure::write('debug', 1);
     Configure::write('App.baseUrl', '');
     $this->_getRequest('/');
     // =====================================================================
     // 上記のBaserTestCase::_getRequest()実行時、 routes.php が呼び出され、
     // Pageモデル等が、テストモードでない状態でインスタンス化されてしまうので一旦、
     // ClassRegistry を初期化する
     // =====================================================================
     ClassRegistry::flush();
 }
开发者ID:naow9y,项目名称:basercms,代码行数:17,代码来源:BaserTestCase.php

示例3: __construct

 /**
  * construct
  *
  * @param string $name
  * @param array $data
  * @param string $dataName
  * @return void
  */
 public function __construct($name = null, array $data = array(), $dataName = '')
 {
     // =====================================================================
     // Router::url() を内部的に利用するテストを実施した場合、Baser/Config/routes.php
     // が呼び出され、そこで利用されている PluginContent / Page モデルを利用する事になる。
     // その際、fixture で接続先を test に切り替えた PluginContent / Page を利用しないと
     // missing table となってい、原因がつかみにくい為、利用していない場合は強制的に
     // 利用する設定とした。
     // =====================================================================
     if (!isset($this->fixtures) || !in_array('baser.Default.PluginContent', $this->fixtures)) {
         $this->fixtures[] = 'baser.Default.PluginContent';
     }
     if (!isset($this->fixtures) || !in_array('baser.Default.Page', $this->fixtures)) {
         $this->fixtures[] = 'baser.Default.Page';
     }
     parent::__construct($name, $data, $dataName);
 }
开发者ID:kenz,项目名称:basercms,代码行数:25,代码来源:BaserTestCase.php

示例4: __construct

 /**
  * Constructor
  *
  * If a class is extending AppTestCase it will merge these with the extending classes
  * so that you don't have to put the plugin fixtures into the AppTestCase
  *
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     if (is_subclass_of($this, 'AppTestCase')) {
         $parentClass = get_parent_class($this);
         $parentVars = get_class_vars($parentClass);
         if (isset($parentVars['fixtures'])) {
             $this->fixtures = array_unique(array_merge($parentVars['fixtures'], $this->fixtures));
         }
         if (!empty($this->plugin)) {
             $this->dependedFixtures = $this->solveDependancies($this->plugin);
         }
         if (!empty($this->dependedFixtures)) {
             foreach ($this->dependedFixtures as $plugin) {
                 $fixtures = $this->loadConfig('fixtures', $plugin);
                 if (!empty($fixtures)) {
                     $this->fixtures = array_unique(array_merge($this->fixtures, $fixtures));
                 }
             }
         }
     }
 }
开发者ID:pmoraes,项目名称:templates,代码行数:30,代码来源:AppTestCase.php

示例5: __construct

 /**
  * Constructor
  *
  * If a class is extending AppTestCase it will merge these with the extending classes
  * so that you don't have to put the plugin fixtures into the AppTestCase
  *
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     if (is_subclass_of($this, 'AppTestCase')) {
         $parentClass = get_parent_class($this);
         $parentVars = get_class_vars($parentClass);
         if (isset($parentVars['fixtures'])) {
             $this->fixtures = array_unique(array_merge($parentVars['fixtures'], $this->fixtures));
         }
         if (isset($parentVars['fixtureGroups'])) {
             $this->fixtureGroups = array_unique(array_merge($parentVars['fixtureGroups'], $this->fixtureGroups));
         }
         if (isset($parentVars['fixtureGroupsConfig'])) {
             $this->fixtureGroupsConfig = array_unique(array_merge($parentVars['fixtureGroupsConfig'], $this->fixtureGroupsConfig));
         }
         if (!empty($this->plugin)) {
             $this->dependedFixtures = $this->solveDependancies($this->plugin);
         }
         if (!empty($this->dependedFixtures)) {
             foreach ($this->dependedFixtures as $plugin) {
                 $fixtures = $this->loadConfig('fixtures', $plugin);
                 if (!empty($fixtures)) {
                     $this->fixtures = array_unique(array_merge($this->fixtures, $fixtures));
                 }
             }
         }
         // inject Configure::read('fixtures');
         $configuredFixtures = Configure::read('fixtures');
         if (is_array($configuredFixtures) && !empty($configuredFixtures)) {
             $this->fixtures = array_unique(array_merge($this->fixtures, $configuredFixtures));
         }
         // inject Configure::read('fixtureGroups');
         $configuredFixtureGroups = Configure::read('fixtureGroups');
         if (is_array($configuredFixtureGroups) && !empty($configuredFixtureGroups)) {
             $this->fixtureGroups = array_unique(array_merge($this->fixtureGroups, $configuredFixtureGroups));
         }
         // inject Configure::read('fixtureGroups');
         $configuredFixtureGroupsConfig = Configure::read('fixtureGroupsConfig');
         if (is_array($configuredFixtureGroupsConfig) && !empty($configuredFixtureGroupsConfig)) {
             $this->fixtureGroupsConfig = Set::merge($this->fixtureGroupsConfig, $configuredFixtureGroupsConfig);
         }
         // inject the fixtureGroups
         foreach ($this->fixtureGroups as $group) {
             if (!array_key_exists($group, $this->fixtureGroupsConfig)) {
                 throw new OutOfBoundsException("Icing.AppTestCase.construct() - unable to find \$group '{$group}' in fixtureGroupsConfig");
             }
             $this->fixtures = array_unique(array_merge($this->fixtures, $this->fixtureGroupsConfig[$group]));
         }
     }
 }
开发者ID:beckye67,项目名称:Icing,代码行数:58,代码来源:AppTestCase.php

示例6: __construct

 /**
  * SqlViewTestCase constructor.
  *
  * @param null   $name
  * @param array  $data
  * @param string $dataName
  */
 public function __construct($name = null, array $data = array(), $dataName = '')
 {
     $this->_sqlViewFixtureHandler = new SqlViewFixtureHandler();
     $this->_sqlViewFixtureHandler->init($this);
     parent::__construct($name, $data, $dataName);
 }
开发者ID:ExpandOnline,项目名称:CakePHPUtil,代码行数:13,代码来源:SqlViewTestCase.php

示例7:

 function __construct()
 {
     $this->fixtures = $this->getFixtures();
     parent::__construct();
 }
开发者ID:jamiemill,项目名称:missioncontrol_core,代码行数:5,代码来源:mission_control_test_case.php

示例8: __construct

 /**
  * Constructor
  *
  * If a class is extending AppTestCase it will merge these with the extending classes
  * so that you don't have to put the plugin fixtures into the AppTestCase
  *
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     $this->checkAppRequirements();
     if (!empty($this->fixtures) || false === $this->fixtures) {
         return;
     }
     $fixtures = $this->loadConfig('fixtures');
     if (!empty($fixtures)) {
         $this->fixtures = array_unique(array_merge($this->fixtures, $fixtures));
     }
     if (is_subclass_of($this, __CLASS__)) {
         $parentClass = get_parent_class($this);
         $parentVars = get_class_vars($parentClass);
         if (isset($parentVars['fixtures'])) {
             $this->fixtures = array_unique(array_merge($parentVars['fixtures'], $this->fixtures));
         }
         if (!empty($this->plugin)) {
             $this->pluginDependencies = $this->solveDependencies($this->plugin);
         }
         if (!empty($this->pluginDependencies)) {
             foreach ($this->pluginDependencies as $plugin) {
                 $fixtures = $this->loadConfig('fixtures', $plugin);
                 if (!empty($fixtures)) {
                     $this->fixtures = array_unique(array_merge($this->fixtures, $fixtures));
                 }
             }
         }
     }
 }
开发者ID:gourmet,项目名称:common,代码行数:38,代码来源:CommonTestCase.php

示例9: __construct

 public function __construct($name = NULL, array $data = array(), $dataName = '')
 {
     parent::__construct($name, $data, $dataName);
 }
开发者ID:stasqc,项目名称:cakephp,代码行数:4,代码来源:BookTest.php


注:本文中的CakeTestCase::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。