本文整理汇总了PHP中TestHelper::Instance方法的典型用法代码示例。如果您正苦于以下问题:PHP TestHelper::Instance方法的具体用法?PHP TestHelper::Instance怎么用?PHP TestHelper::Instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TestHelper
的用法示例。
在下文中一共展示了TestHelper::Instance方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$this->helper = \TestHelper::Instance();
$this->initPluginNamespaces();
$this->initTestNamespace();
$this->initServiceContainerSubscriber();
}
示例2: setUp
public function setUp()
{
$helper = \TestHelper::Instance();
$loader = $helper->Container()->get('loader');
$pluginDir = $helper->DocPath() . 'engine/Shopware/Plugins/Default/Core/RestApi';
$loader->registerNamespace('ShopwarePlugins\\RestApi\\Components', $pluginDir . '/Components/');
$this->router = new Router();
}
示例3: setUp
public function setUp()
{
parent::setUp();
$helper = \TestHelper::Instance();
$loader = $helper->Loader();
$pluginDir = getcwd() . '/../';
$loader->registerNamespace('Shopware\\SwagModelPlugin', $pluginDir);
}
示例4: setUp
/**
*
*/
public function setUp()
{
parent::setUp();
$app = TestHelper::Instance();
$request = $this->Request();
$request->setPathInfo(null);
$this->Front()->setRequest($request);
//$this->Template()->force_compile = true;
$this->Template()->addTemplateDir($app->TestPath('DataSets'), 'Ticket5302');
}
示例5: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp()
{
parent::setUp();
$helper = TestHelper::Instance();
$hostname = $helper->Shop()->getHost();
if (empty($hostname)) {
$this->markTestSkipped('Hostname is not available.');
}
$this->apiBaseUrl = 'http://' . $hostname . $helper->Shop()->getBasePath() . '/api';
Shopware()->Db()->query('UPDATE s_core_auth SET apiKey = ? WHERE username LIKE "demo"', array(sha1('demo')));
}
示例6: setUpBeforeClass
public static function setUpBeforeClass()
{
parent::setUpBeforeClass();
$helper = \TestHelper::Instance();
$loader = $helper->Loader();
$pluginDir = $helper->DocPath() . 'engine/Shopware/Plugins/Default/Core/PaymentMethods';
$loader->registerNamespace('ShopwarePlugin\\PaymentMethods\\Components', $pluginDir . '/Components/');
//Debit needs to be active for this. Also, we need to save existing status to later restore it
$debitPaymentMean = Shopware()->Models()->getRepository('\\Shopware\\Models\\Payment\\Payment')->findOneByName('debit');
self::$debitStatus = $debitPaymentMean->getActive();
$debitPaymentMean->setActive(true);
Shopware()->Models()->flush($debitPaymentMean);
self::$debitPaymentMethod = new DebitPaymentMethod();
}
示例7: basename
<?php
require "./../../../../../../tests/Shopware/TestHelper.php";
$pluginDir = __DIR__ . '/../';
$pluginName = basename(dirname(__DIR__));
$pluginFolder = basename(dirname(dirname(__DIR__)));
require_once $pluginDir . '/vendor/autoload.php';
\TestHelper::Instance()->Loader()->registerNamespace('Shopware\\Plugins\\' . $pluginName, $pluginDir);
\TestHelper::Instance()->Loader()->registerNamespace('Shopware\\Plugin\\Debug', $pluginDir . '../../../Default/Core/Debug/');
\TestHelper::Instance()->Loader()->registerNamespace('Shopware\\Tests\\' . $pluginName, __DIR__ . '/');
Shopware()->Front()->setRequest(new Enlight_Controller_Request_RequestHttp());
示例8:
<?php
require "./../../../../../../tests/Shopware/TestHelper.php";
$helper = \TestHelper::Instance();
$loader = $helper->Loader();
$pluginDir = __DIR__ . '/../';
$loader->registerNamespace('Shopware\\SwagMd5Reversed', $pluginDir);