public function spiderUnitTest() { $object = new spider(); $expected = array("5", "7", "Right"); $actual = $object->spider(20, 20, 4, 10, Left, FLFLFRFFLF); $this->assertSame(array_diff($expected, $actual), array_diff($actual, $expected)); }
function spiderform_action() { $x = isset($_POST['x']) ? $_POST['x'] : ''; $y = isset($_POST['y']) ? $_POST['y'] : ''; $m = isset($_POST['m']) ? $_POST['m'] : ''; $n = isset($_POST['n']) ? $_POST['n'] : ''; $path = isset($_POST['path']) ? $_POST['path'] : ''; $dir_str = isset($_POST['dir']) ? $_POST['dir'] : ''; $spider = new spider($x, $y, $m, $n, $dir_str, $path); $spider->spider($x, $y, $m, $n, $dir_str, $path); }