本文整理汇总了PHP中VF_Singleton类的典型用法代码示例。如果您正苦于以下问题:PHP VF_Singleton类的具体用法?PHP VF_Singleton怎么用?PHP VF_Singleton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了VF_Singleton类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: testShouldReturnInjectedDatabase
function testShouldReturnInjectedDatabase()
{
$database = new VF_TestDbAdapter(array('dbname' => VAF_DB_NAME, 'username' => VAF_DB_USERNAME, 'password' => VAF_DB_PASSWORD));
$singleton = new VF_Singleton();
$singleton->setReadAdapter($database);
$this->assertSame($database, $singleton->getReadAdapter(), 'should return injected database');
}
开发者ID:vehiclefits,项目名称:library,代码行数:7,代码来源:DatabaseTest.php
示例2: testNewRequest
function testNewRequest()
{
$singleton = new VF_Singleton();
$request = $singleton->getRequest();
// make sure it doesn't run Magento specific code here
$this->assertNull($request);
// we won't get here if it did.
}
开发者ID:xiaoguizhidao,项目名称:autotech_design,代码行数:8,代码来源:RequestTest.php
示例3: testSelection
function testSelection()
{
$vehicle = $this->createMMY(self::MAKE, self::MODEL, self::YEAR);
$request = $this->getRequest($vehicle->toValueArray());
$helper = new VF_Singleton();
$helper->setRequest($request);
$vehicle = $helper->vehicleSelection();
$this->assertMMYTitlesEquals(self::MAKE, self::MODEL, self::YEAR, $vehicle);
}
开发者ID:ngagestudios,项目名称:Vehicle-Fits-Magento,代码行数:9,代码来源:SnippetTest.php
示例4: testCount1
function testCount1()
{
$sitemap = new Elite_Vafsitemap_Model_Sitemap_Vehicle(VF_Singleton::getInstance()->getConfig());
$vehicle = $this->createMMTC();
$this->insertMappingMMTC($vehicle);
$this->assertEquals(1, $sitemap->vehicleCount());
}
开发者ID:hashir-dhattiwala,项目名称:vfmagento,代码行数:7,代码来源:CountMMTCTest.php
示例5: testShouldCreateSchemaOverCommandLine
function testShouldCreateSchemaOverCommandLine()
{
$command = __DIR__ . '/vf schema --force --levels="year,make,model"';
exec($command);
$schema = VF_Singleton::getInstance()->schema();
$this->assertEquals(array('year', 'make', 'model'), $schema->getLevels(), 'should create default schema of MMY');
}
开发者ID:vehiclefits,项目名称:library,代码行数:7,代码来源:schemaTest.php
示例6: doSetUp
function doSetUp()
{
$this->switchSchema('make,model,year');
$this->expectedDefinition = $this->createMMY();
$this->setRequestParams($this->expectedDefinition->toValueArray());
$this->sitemap = new Elite_Vafsitemap_Model_Sitemap_Product_Sub(VF_Singleton::getInstance()->getConfig());
}
开发者ID:hashir-dhattiwala,项目名称:vfmagento,代码行数:7,代码来源:HtmlTest.php
示例7: listAction
function listAction()
{
$helper = VF_Singleton::getInstance();
$helper->setRequest($this->getRequest());
$helper->storeFitInSession();
if (!$helper->vehicleSelection() || !$helper->getProductIds()) {
return $this->redirectToHomePage();
}
$this->myLoadLayout();
switch (VF_Singleton::getInstance()->getConfig()->homepagesearch->mode) {
case 'grid':
// set in layout.xml
break;
default:
case 'group':
// unset the grid block added from layout.xml
$this->getLayout()->getBlock('content')->unsetChild('vaf_products');
$block = $this->createBlock('vaf/product_result_group', 'vaf_products');
$this->appendBlock($block);
break;
case 'category':
// unset the grid block added from layout.xml
$this->getLayout()->getBlock('content')->unsetChild('vaf_products');
$block = $this->createBlock('vaf/product_result_group2', 'vaf_products');
$this->appendBlock($block);
break;
case 'group3':
// unset the grid block added from layout.xml
$this->getLayout()->getBlock('content')->unsetChild('vaf_products');
$block = $this->createBlock('vaf/product_result_group3', 'vaf_products');
$this->appendBlock($block);
break;
}
$this->renderLayout();
}
开发者ID:hashir-dhattiwala,项目名称:vfmagento,代码行数:35,代码来源:ProductController.php
示例8: testGetProductIDsWithSpace
function testGetProductIDsWithSpace()
{
$vehicle2 = $this->createMMY('Ford', 'F 150', '2000');
$this->insertMappingMMY($vehicle2, 2);
$this->setRequestParams($vehicle2->toTitleArray());
$this->assertEquals(array(2), VF_Singleton::getInstance()->getProductIds());
}
开发者ID:vehiclefits,项目名称:library,代码行数:7,代码来源:FitAlphaTest.php
示例9: getConfig
function getConfig()
{
if (!$this->config instanceof Zend_Config) {
$this->config = VF_Singleton::getInstance()->getConfig();
}
return $this->config;
}
开发者ID:hashir-dhattiwala,项目名称:vfmagento,代码行数:7,代码来源:Category.php
示例10: testDefinitionsMMY
function testDefinitionsMMY()
{
$sitemap = new Elite_Vafsitemap_Model_Sitemap_Vehicle(VF_Singleton::getInstance()->getConfig());
$vehicles = $sitemap->getDefinitions(10);
$this->assertTrue($vehicles[0] instanceof VF_Vehicle);
$this->assertNotEquals(0, (int) $vehicles[0]->getLevel('year')->getId());
}
开发者ID:hashir-dhattiwala,项目名称:vfmagento,代码行数:7,代码来源:DefinitionMMYTest.php
示例11: block
protected function block($config = array(), $request)
{
$block = new Elite_Vaf_Block_Search_SubmitTestSub();
$block->setConfig($this->config($config));
VF_Singleton::getInstance()->setRequest($request);
return $block;
}
开发者ID:hashir-dhattiwala,项目名称:vfmagento,代码行数:7,代码来源:SubmitActionPerCategoryTest.php
示例12: indexAction
function indexAction()
{
if (!VF_Singleton::getInstance()->getConfig()->seo->htmlSitemap) {
return;
}
$this->loadLayoutAndBlock();
}
开发者ID:hashir-dhattiwala,项目名称:vfmagento,代码行数:7,代码来源:ProductController.php
示例13: getSelections
function getSelections()
{
$startTime = time();
$vehicle = VF_Singleton::getInstance()->vehicleSelection();
if (Mage::app()->getStore()->isAdmin()) {
return $this->getData('selections');
}
if (!$this->superProductFits($vehicle)) {
return $this->getData('selections');
}
$selections = $this->getData('selections');
if (!$selections) {
return;
}
if ($vehicle && $vehicle->getLeafValue()) {
$productIds = VF_Singleton::getInstance()->getProductIds();
$return = array();
foreach ($selections as $product) {
if (in_array($product->getId(), $productIds)) {
array_push($return, $product);
}
}
return $return;
}
$endTime = time();
var_dump($endTime - $startTime);
exit;
return $selections;
}
开发者ID:hashir-dhattiwala,项目名称:vfmagento,代码行数:29,代码来源:Option.php
示例14: testShouldClearFromSession
function testShouldClearFromSession()
{
$flexibleSearch = $this->flexibleWheeladapterSearch(array('wheel_stud_spread' => '114.3'));
VF_Singleton::getInstance()->storeFitInSession();
$flexibleSearch = $this->flexibleWheeladapterSearch(array('wheel_stud_spread' => '0'));
VF_Singleton::getInstance()->storeFitInSession();
$this->assertNull($this->flexibleWheeladapterSearch()->wheelSideStudSpread(), 'should clear wheel side stud spread from session');
}
开发者ID:ngagestudios,项目名称:Vehicle-Fits-Magento,代码行数:8,代码来源:WheelSideSpreadTest.php
示例15: testShouldClearFromSession
function testShouldClearFromSession()
{
$flexibleSearch = $this->flexibleTireSearch(array('section_width' => '205', 'aspect_ratio' => '55', 'diameter' => '16'));
VF_Singleton::getInstance()->storeFitInSession();
$flexibleSearch = $this->flexibleTireSearch(array('section_width' => '0', 'aspect_ratio' => '0', 'diameter' => '0'));
VF_Singleton::getInstance()->storeFitInSession();
$this->assertNull($this->flexibleTireSearch()->diameter(), 'should clear diameter from session');
}
开发者ID:vehiclefits,项目名称:library,代码行数:8,代码来源:DiameterTest.php
示例16: testShouldClearFromSession
function testShouldClearFromSession()
{
$flexibleSearch = $this->flexibleWheelSearch(array('lug_count' => '5'));
VF_Singleton::getInstance()->storeFitInSession();
$flexibleSearch = $this->flexibleWheelSearch(array('lug_count' => '0'));
VF_Singleton::getInstance()->storeFitInSession();
$this->assertEquals(0, $this->flexibleWheelSearch()->lugCount(), 'should clear lug count from session');
}
开发者ID:vehiclefits,项目名称:library,代码行数:8,代码来源:LugCountTest.php
示例17: testShouldClearFromSession
function testShouldClearFromSession()
{
$flexibleSearch = $this->flexibleWheeladapterSearch(array('wheel_lug_count' => '5'));
VF_Singleton::getInstance()->storeFitInSession();
$flexibleSearch = $this->flexibleWheeladapterSearch(array('wheel_lug_count' => '0'));
VF_Singleton::getInstance()->storeFitInSession();
$this->assertNull($this->flexibleWheeladapterSearch()->wheelSideLugCount(), 'should clear wheel side lug count from session');
}
开发者ID:ngagestudios,项目名称:Vehicle-Fits-Magento,代码行数:8,代码来源:WheelSideLugCountTest.php
示例18: testShouldClearFromSession
function testShouldClearFromSession()
{
$flexibleSearch = $this->flexibleWheelSearch(array('stud_spread' => '5'));
VF_Singleton::getInstance()->storeFitInSession();
$flexibleSearch = $this->flexibleWheelSearch(array('stud_spread' => '0'));
VF_Singleton::getInstance()->storeFitInSession();
$this->assertEquals(0, $this->flexibleWheelSearch()->studSpread(), 'should clear stud spread from session');
}
开发者ID:xiaoguizhidao,项目名称:autotech_design,代码行数:8,代码来源:StudSpreadTest.php
示例19: getSchema
function getSchema()
{
$schema = VF_Singleton::getInstance()->schema();
if (!is_null($this->getConfig())) {
$schema->setConfig($this->getConfig());
}
return $schema;
}
开发者ID:hashir-dhattiwala,项目名称:vfmagento,代码行数:8,代码来源:Slug.php
示例20: testShouldClearVehicleSelection
function testShouldClearVehicleSelection()
{
$vehicle = $this->createVehicle(array('make' => 'Honda', 'model' => 'Civic', 'year' => '2000'));
$this->setRequestParams($vehicle->toValueArray());
$this->assertEquals($vehicle->toValueArray(), VF_Singleton::getInstance()->vehicleSelection()->toValueArray(), 'should first select a vehicle');
$this->setRequestParams(array('lug_count' => '5', 'stud_spread' => '114.3'));
VF_Singleton::getInstance()->flexibleSearch()->doGetProductIds();
$this->assertNull(VF_Singleton::getInstance()->vehicleSelection()->getFirstVehicle(), 'should clear vehicle when searching on a wheel size');
}
开发者ID:xiaoguizhidao,项目名称:autotech_design,代码行数:9,代码来源:WheelSearchTest.php
注:本文中的VF_Singleton类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论