matchFile() public static method

Compares results using mask sorted in file.
public static matchFile ( $file, $actual, $description = NULL ) : void
return void
Exemplo n.º 1
0
 function testRender()
 {
     Helper::request($this->params);
     ob_start();
     Helper::$grid->render();
     $output = ob_get_clean();
     Assert::matchFile(__DIR__ . "/files/render.expect", $output);
 }
Exemplo n.º 2
0
 function testRender()
 {
     Helper::request($this->params);
     ob_start();
     Helper::$grid->render();
     $output = ob_get_clean();
     //@todo - resolve this wtf? different sorting (dibi and nette db) vs (doctrine and array source)
     $type = in_array(get_called_class(), array('Grido\\Tests\\ArraySourceTest', 'Grido\\Tests\\DoctrineTest')) ? 2 : 1;
     Assert::matchFile(__DIR__ . "/files/render.{$type}.expect", $output);
 }
Exemplo n.º 3
0
 protected function checkRenderOutput(IComponent $control, $expected, array $renderParameters = [])
 {
     if (!$control->getParent()) {
         $this->attachToPresenter($control);
     }
     ob_start();
     $control->render(...$renderParameters);
     if (is_file($expected)) {
         \Tester\Assert::matchFile($expected, ob_get_clean());
     } else {
         \Tester\Assert::match($expected, ob_get_clean());
     }
 }
 private function testFix()
 {
     exec(Tester::$setup['fixerPath'] . ' ' . Tester::$setup['invalidDir'] . $this->testedFile->getName() . '.php --standard=../ruleset.xml --suffix=.fixed', $out, $status);
     if ($status === 1) {
         $content = file_get_contents(Tester::$setup['invalidDir'] . $this->testedFile->getName() . '.php.fixed');
         Assert::matchFile(Tester::$setup['validDir'] . $this->testedFile->getName() . '.php', $content);
     }
 }
Exemplo n.º 5
0
}
Assert::equal(ACTIVE_INDEX, $_index);
/**
 * RECURSIVE RENDER ************************************************************
 * *****************************************************************************
 */
Assert::matchFile(__DIR__ . '/data/menu.html', buildHtmlRecursiveMenu($menu));
/**
 * CYCLE RENDER ****************************************************************
 * *****************************************************************************
 */
Assert::matchFile(__DIR__ . '/data/menu.html', buildHtmlCycleMenu($menu->getIndexes(), $menu));
// RecursiveTreeIterator not work for php 5.4
$tree = new RecursiveTreeIterator($menu, RecursiveTreeIterator::BYPASS_KEY | RecursiveTreeIterator::BYPASS_CURRENT);
Assert::matchFile(__DIR__ . '/data/menu.html', buildHtmlCycleMenu($tree, $menu));
/**
 * HIDE ITEM *******************************************************************
 * *****************************************************************************
 */
$_items = $items;
$_items[0]['hide'] = TRUE;
$menuHide = Menu\MenuFactory::createFromArray($_items);
Assert::matchFile(__DIR__ . '/data/menu-hide.html', buildHtmlRecursiveMenu($menuHide));
/**
 * SQL STRUCTURE ***************************************************************
 * *****************************************************************************
 */
$sqlMenu = Menu\MenuFactory::createFromSql(Transform::array2sql($menu));
$sqlMenu->setActiveItem(Transform::getId(ACTIVE_INDEX));
Assert::matchFile(__DIR__ . '/data/menu.html', buildHtmlRecursiveMenu($sqlMenu));
echo 'ok';