本文整理汇总了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');
}
示例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');
}
示例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');
}
示例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');
}
示例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');
}
示例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));
}
示例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`');
}
示例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"');
}
示例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' );
}
示例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');
}
示例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();
}
}
示例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');
}
示例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');
}
示例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>