本文整理匯總了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);