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


PHP VF_Schema::create方法代码示例

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


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

示例1: testShouldGetSchemaById

 function testShouldGetSchemaById()
 {
     $schema = VF_Schema::create('foo,bar');
     $schemaID = $schema->id();
     $new_schema = new VF_Schema($schemaID);
     $this->assertEquals(array('foo', 'bar'), $new_schema->getLevels(), 'should look up schema specified by ID passed to constructor');
 }
开发者ID:xiaoguizhidao,项目名称:autotech_design,代码行数:7,代码来源:MultipleTest.php

示例2: testShouldFindInSecondSchema

 function testShouldFindInSecondSchema()
 {
     $schema = VF_Schema::create('foo,bar');
     $vehicle = $this->createVehicle(array('foo' => '123', 'bar' => '456'), $schema);
     $found = $this->getFinder($schema)->findOneByLevelIds(array('foo' => $vehicle->getValue('foo')));
     $this->assertEquals($vehicle->getValue('foo'), $found->getValue('foo'), 'should find in second schema');
 }
开发者ID:xiaoguizhidao,项目名称:autotech_design,代码行数:7,代码来源:ByLevelIdsTest.php

示例3: testSaveParenetheses

 function testSaveParenetheses()
 {
     $schema = VF_Schema::create('foo,bar');
     $vehicle = VF_Vehicle::create($schema, array('foo' => 'valfoo', 'bar' => 'valbar'));
     $vehicle->save();
     $vehicleExists = $this->vehicleExists(array('foo' => 'valfoo', 'bar' => 'valbar'), false, $schema);
     $this->assertTrue($vehicleExists, 'should find vehicles in different schema');
 }
开发者ID:vehiclefits,项目名称:library,代码行数:8,代码来源:VehicleMultipleSchemaTest.php

示例4: testShouldSaveMappingInSecondSchema

 function testShouldSaveMappingInSecondSchema()
 {
     $schema = VF_Schema::create('foo,bar');
     $vehicle = $this->createVehicle(array('foo' => '123', 'bar' => '456'), $schema);
     $mapping = new VF_Mapping(1, $vehicle);
     $id = $mapping->save();
     $this->assertTrue($id > 0, 'should save mapping in second schema');
 }
开发者ID:vehiclefits,项目名称:library,代码行数:8,代码来源:MappingTest.php

示例5: testVehicleExists

 function testVehicleExists()
 {
     return $this->markTestIncomplete();
     
     $schema = VF_Schema::create('foo,bar');
     $finder = new VF_Vehicle_Finder($schema);
     $this->assertFalse($finder->vehicleExists(array('foo'=>'test','bar'=>'doesntexist')), 'vehicle should not exist');
 }
开发者ID:ngagestudios,项目名称:magento.vehiclefits.com,代码行数:8,代码来源:MultipleSchemaTest.php

示例6: testSaveActionNewMultipleSchemas

 function testSaveActionNewMultipleSchemas()
 {
     $schema = VF_Schema::create('foo,bar');
     $request = $this->getRequest(array('save' => self::ARBITRARY_STRING, 'title' => '123', 'entity' => 'foo', 'schema' => $schema->id()));
     $controller = $this->definitionsController($request);
     $controller->saveAction();
     $this->assertTrue($this->vehicleExists(array('foo' => '123'), true, $schema));
 }
开发者ID:hashir-dhattiwala,项目名称:vfmagento,代码行数:8,代码来源:ShouldSaveTest.php

示例7: testShouldGenerateMultipleSchemas

 function testShouldGenerateMultipleSchemas()
 {
     $this->schemaGenerator()->execute(array('make', 'model', 'year'));
     $schema = VF_Schema::create('foo,bar');
     $expectedTable = 'elite_level_' . $schema->id() . '_foo';
     $tables = $this->getReadAdapter()->listTables();
     $this->assertTrue(in_array($expectedTable, $tables), 'should create table for new schema `elite_level_x_foo`');
 }
开发者ID:xiaoguizhidao,项目名称:autotech_design,代码行数:8,代码来源:GeneratorTest.php

示例8: testShuoldListFromSecondSchema

 function testShuoldListFromSecondSchema()
 {
     $schema = VF_Schema::create('foo,bar');
     $vehicle = $this->createVehicle(array('foo' => '123', 'bar' => '456'), $schema);
     $mapping = new VF_Mapping(1, $vehicle);
     $mapping->save();
     $foo = new VF_Level('foo', null, $schema);
     $actual = $foo->listInUse();
     $this->assertEquals('123', $actual[0], 'should list for level in 2nd schema "foo"');
 }
开发者ID:vehiclefits,项目名称:library,代码行数:10,代码来源:ListInUseMultipleSchemaTest.php

示例9: testSaveParenetheses

    function testSaveParenetheses()
    {
        return $this->markTestIncomplete();
        
        $schema = VF_Schema::create('foo,bar');
        
        $vehicle = VF_Vehicle::create($schema, array('foo'=>'valfoo','bar'=>'valbar'));
	$vehicle->save();
        
        $this->assertTrue($this->vehicleExists(array('foo'=>'valfoo','bar'=>'valbar')), 'should find vehicles in different schema' );
    }
开发者ID:ngagestudios,项目名称:magento.vehiclefits.com,代码行数:11,代码来源:VehicleMultipleSchemaTest.php

示例10: testShouldListChildLevel_WhenCalledFromBackend

 function testShouldListChildLevel_WhenCalledFromBackend()
 {
     $schema = VF_Schema::create('foo,bar');
     $vehicle = $this->createVehicle(array('foo' => '123', 'bar' => '456'), $schema);
     $mapping = new VF_Mapping(1, $vehicle);
     $mapping->save();
     ob_start();
     $_GET['requestLevel'] = 'bar';
     $_GET['foo'] = $vehicle->getValue('bar');
     $ajax = new VF_Ajax();
     $ajax->execute($schema);
     $actual = ob_get_clean();
     $this->assertEquals('<option value="' . $vehicle->getValue('bar') . '">456</option>', $actual, 'should list child levels from 2nd schema');
 }
开发者ID:vehiclefits,项目名称:library,代码行数:14,代码来源:MultipleSchemaTest.php

示例11: doMain

 function doMain($options)
 {
     if (!$options['levels']) {
         $this->askUserLevels();
     } else {
         $this->levels = $options['levels'];
     }
     if (!$options['add'] && !$options['force']) {
         $this->confirmTablesToDrop();
     }
     if (!$options['add']) {
         $this->generator->dropExistingTables();
     }
     if ($options['add']) {
         VF_Schema::create($options['levels']);
         $this->notifyUser(self::DONE);
     } else {
         $this->createTheNewTables();
     }
 }
开发者ID:xiaoguizhidao,项目名称:autotech_design,代码行数:20,代码来源:Schema.php

示例12: testGetNewSchemasLevels

 function testGetNewSchemasLevels()
 {
     $schema1 = VF_Schema::create('foo,bar');
     $schema2 = new VF_Schema;
     $this->assertEquals(array('foo','bar'),$schema1->getLevels(), 'should get new schemas levels');
 }
开发者ID:ngagestudios,项目名称:magento.vehiclefits.com,代码行数:6,代码来源:MultipleTest.php

示例13: testShouldListChildrenLevelsInSecondSchema

 function testShouldListChildrenLevelsInSecondSchema()
 {
     $schema = VF_Schema::create('foo,bar');
     $vehicle = $this->createVehicle(array('foo' => '123', 'bar' => '456'), $schema);
     $bar = new VF_Level('bar', null, $schema);
     $actual = $bar->listAll($vehicle->getValue('foo'));
     $this->assertEquals('456', $actual[0]->getTitle(), 'should list children levels in 2nd schema');
 }
开发者ID:vehiclefits,项目名称:library,代码行数:8,代码来源:MMYTest.php

示例14: session_start

 * @copyright  Copyright (c) 2013 Vehicle Fits, llc
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
session_start();
if (file_exists('../config.php')) {
    require_once '../config.php';
} else {
    require_once '../config.default.php';
}
require_once getenv('PHP_MAGE_PATH') . '/app/code/local/Elite/Vaf/bootstrap-tests.php';
file_put_contents(sys_get_temp_dir() . '/vf-ajax-tests', '1');
$schemaGenerator = new VF_Schema_Generator();
$schemaGenerator->dropExistingTables();
$schemaGenerator->execute(array('make', 'model', 'year'));
$schema1 = new VF_Schema(1);
$schema2 = VF_Schema::create('foo,bar');
$vehicle = VF_Vehicle::create($schema1, array('make' => 'Honda_Unique' . uniqid(), 'model' => 'Civic', 'year' => '2002'));
$vehicle->save();
$values = $vehicle->toValueArray();
$vehicle2 = VF_Vehicle::create($schema2, array('foo' => 123, 'bar' => 456));
$vehicle2->save();
$values2 = $vehicle2->toValueArray();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <link rel="stylesheet" href="../qunit/qunit.css" type="text/css"/>
    <link rel="stylesheet" href="/skin/adminhtml/default/default/multiTree.css" type="text/css"/>
</head>
<body>
开发者ID:vehiclefits,项目名称:library,代码行数:31,代码来源:MMYMultiple.php


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