Пример #1
0
 public function testNormalDiff()
 {
     $arrArgs = array();
     $arrArgs['-t'] = "json";
     $arrArgs['-l'] = "left.json";
     $arrArgs['-r'] = "right.json";
     $arrArgs['-o'] = "diff_out_file";
     $diff = DiffBase::getDiffObj($arrArgs);
     $this->assertTrue($diff->findDiffs());
 }
Пример #2
0
<?php

/**
 * @file diff.php
 * @author wangjie
 * @date 2015/06/27 16:01:31
 * @brief 
 *  
 **/
require_once "json_diff.php";
require_once "xml_diff.php";
require_once "args_handler.php";
//$handler = new ArgsHandler($argv);
//if (!$handler->parseArgs()) {
//    echo "parse error\n";
//}
//$handler->printArgs();
//var_dump($argv);
$handler = new ArgsHandler($argv);
$args = $handler->getArgs();
if (!empty($args)) {
    $diff = DiffBase::getDiffObj($args);
}
if (is_a($diff, "DiffBase") && $diff->findDiffs()) {
    $diff->outputDiffs();
}
//$diff->outputDiffs();
/* vim: set expandtab ts=4 sw=4 sts=4 tw=100: */