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'); }
function execute() { $schema = new VF_Schema(); $ajax = new VF_Ajax(); return $ajax->execute( $schema ); }
function testShouldListModelsNotInUseIfConfigSaysTo() { $vehicle = $this->createVehicle(array('make' => 'Honda', 'model' => 'Civic', 'year' => 2000)); $_GET['make'] = 'Honda'; $_GET['requestLevel'] = 'model'; ob_start(); $_GET['front'] = 1; $config = new Zend_Config(array('search' => array('showAllOptions' => 'true'))); $ajax = new VF_Ajax(); $ajax->setConfig($config); $ajax->execute($this->getSchema()); $actual = ob_get_clean(); $expected = '<option value="Civic">Civic</option>'; $this->assertEquals($expected, $actual, 'should list models not in use if config says to'); }
function execute() { $schema = new VF_Schema(isset($_GET['schema']) ? $_GET['schema'] : 1); $ajax = new VF_Ajax(); return $ajax->execute($schema); }