public function testKaiList()
 {
     $Expected = array('-item', '-item', '-item');
     $Actual = cyps_load_file('indent_1.yaml');
     $this->assertEquals($Expected, $Actual['kai_list_of_items']);
 }
Example #2
0
        {
            if ($group[0] == '&') {
                $this->_containsGroupAnchor = substr($group, 1);
            }
            if ($group[0] == '*') {
                $this->_containsGroupAlias = substr($group, 1);
            }
            //print_r ($this->path);
        }
        private function stripGroup($line, $group)
        {
            $line = trim(str_replace($group, '', $line));
            return $line;
        }
    }
}
// Enable use of Cyps from command line
// The syntax is the following: php Cyps.php cyps.yaml
do {
    if (PHP_SAPI != 'cli') {
        break;
    }
    if (empty($_SERVER['argc']) || $_SERVER['argc'] < 2) {
        break;
    }
    if (empty($_SERVER['PHP_SELF']) || FALSE === strpos($_SERVER['PHP_SELF'], 'Cyps.php')) {
        break;
    }
    $file = $argv[1];
    echo json_encode(cyps_load_file($file));
} while (0);