Пример #1
0
 protected function __($text)
 {
     return $this->searchForm->translate($text);
 }
Пример #2
0
 function showSearchButton()
 {
     $block = new VF_Search_Form();
     $block->setConfig($this->getConfig());
     return $block->showSearchButton();
 }
Пример #3
0
 public function testWhereListEntitiesFiltersRequestParamsToOnlyDisplaySingleEntity()
 {
     $this->switchSchema('make,model,year,engine');
     $chevroletTahoe = $this->createVehicle(array('make' => 'Chevrolet', 'model' => 'Tahoe', 'year' => '2002', 'engine' => '5.3L V8'));
     $toyotaCamry = $this->createVehicle(array('make' => 'Toyota', 'model' => 'Camry', 'year' => '2002', 'engine' => '2.4L 2AZ-FE'));
     $chevyAstro = $this->createVehicle(array('make' => 'Chevrolet', 'model' => 'Astro Van', 'year' => '2001', 'engine' => '4.3L V6'));
     $this->insertMapping($chevroletTahoe, 1);
     $this->insertMapping($toyotaCamry, 2);
     $this->insertMapping($chevyAstro, 5);
     $request = new Zend_Controller_Request_Http();
     $request->setParam('make', $chevroletTahoe->getLevel('make')->getId());
     $request->setParam('model', $chevroletTahoe->getLevel('model')->getId());
     $request->setParam('year', $chevroletTahoe->getLevel('year')->getId());
     $searchForm = new VF_Search_Form();
     VF_Singleton::getInstance()->setRequest($request);
     $entities = $searchForm->listEntities('engine');
     $this->assertEquals(1, count($entities));
     $this->assertArrayOnlyHasLevelIDPresent($entities, $chevroletTahoe->getLevel('engine'));
 }