Windows NT KAMIDAKI 10.0 build 19045 (Windows 10) AMD64
Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.3.9
Server IP : 192.168.3.16 & Your IP : 216.73.216.204
Domains :
Cant Read [ /etc/named.conf ]
User : SISTEMA
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
C: /
xampp /
php /
pear /
tests /
Delete
Unzip
Name
Size
Permission
Date
Action
01glob.phpt
815
B
-rw-rw-rw-
2016-01-27 12:10
02maptree.phpt
2.21
KB
-rw-rw-rw-
2016-01-27 12:10
03maptreemultiple.phpt
1.31
KB
-rw-rw-rw-
2016-01-27 12:10
04search.phpt
1.12
KB
-rw-rw-rw-
2016-01-27 12:10
05search_inside.phpt
1.31
KB
-rw-rw-rw-
2016-01-27 12:10
06match_shell.phpt
2.34
KB
-rw-rw-rw-
2016-01-27 12:10
1.phpt
370
B
-rw-rw-rw-
2016-01-27 12:12
10.phpt
1.65
KB
-rw-rw-rw-
2016-01-27 12:12
11.phpt
484
B
-rw-rw-rw-
2016-01-27 12:12
12.phpt
546
B
-rw-rw-rw-
2016-01-27 12:12
13.phpt
567
B
-rw-rw-rw-
2016-01-27 12:12
14.phpt
941
B
-rw-rw-rw-
2016-01-27 12:12
15.phpt
735
B
-rw-rw-rw-
2016-01-27 12:12
16.phpt
759
B
-rw-rw-rw-
2016-01-27 12:12
17.phpt
903
B
-rw-rw-rw-
2016-01-27 12:12
18.phpt
423
B
-rw-rw-rw-
2016-01-27 12:12
19.phpt
497
B
-rw-rw-rw-
2016-01-27 12:12
2.phpt
407
B
-rw-rw-rw-
2016-01-27 12:12
20.phpt
545
B
-rw-rw-rw-
2016-01-27 12:12
21.phpt
568
B
-rw-rw-rw-
2016-01-27 12:12
22.phpt
703
B
-rw-rw-rw-
2016-01-27 12:12
23.phpt
621
B
-rw-rw-rw-
2016-01-27 12:12
24.phpt
1013
B
-rw-rw-rw-
2016-01-27 12:12
25.phpt
621
B
-rw-rw-rw-
2016-01-27 12:12
26.phpt
1.27
KB
-rw-rw-rw-
2016-01-27 12:12
27.phpt
1.52
KB
-rw-rw-rw-
2016-01-27 12:12
28.phpt
1.52
KB
-rw-rw-rw-
2016-01-27 12:12
29.phpt
1.14
KB
-rw-rw-rw-
2016-01-27 12:12
3.phpt
494
B
-rw-rw-rw-
2016-01-27 12:12
30.phpt
1.28
KB
-rw-rw-rw-
2016-01-27 12:12
31.phpt
2
KB
-rw-rw-rw-
2016-01-27 12:12
4.phpt
673
B
-rw-rw-rw-
2016-01-27 12:12
5.phpt
1.18
KB
-rw-rw-rw-
2016-01-27 12:12
6.phpt
1.83
KB
-rw-rw-rw-
2016-01-27 12:12
7.phpt
966
B
-rw-rw-rw-
2016-01-27 12:12
8.phpt
354
B
-rw-rw-rw-
2016-01-27 12:12
9.phpt
1.82
KB
-rw-rw-rw-
2016-01-27 12:12
AllTests.php
754
B
-rw-rw-rw-
2016-01-27 12:11
DispatcherTest.php
5.04
KB
-rw-rw-rw-
2016-01-27 12:11
Getargs_basic_testcase.php
15.55
KB
-rw-rw-rw-
2016-01-27 12:10
Getargs_getValues_testcase.php
9.75
KB
-rw-rw-rw-
2016-01-27 12:10
bug2773.phpt
771
B
-rw-rw-rw-
2016-01-27 12:10
setup.php
937
B
-rw-rw-rw-
2016-01-27 12:10
testBasic_apiVersion.phpt
449
B
-rw-rw-rw-
2016-01-27 12:11
testBasic_attributesToString.phpt
3.55
KB
-rw-rw-rw-
2016-01-27 12:11
testBasic_collapseEmptyTags.phpt
1.75
KB
-rw-rw-rw-
2016-01-27 12:11
testBasic_createCDataSection.phpt
494
B
-rw-rw-rw-
2016-01-27 12:11
testBasic_createComment.phpt
471
B
-rw-rw-rw-
2016-01-27 12:11
testBasic_createEndElement.phpt
696
B
-rw-rw-rw-
2016-01-27 12:11
testBasic_createStartElement.phpt
3.68
KB
-rw-rw-rw-
2016-01-27 12:11
testBasic_createTag.phpt
5.78
KB
-rw-rw-rw-
2016-01-27 12:11
testBasic_createTagFromArray.phpt
9.09
KB
-rw-rw-rw-
2016-01-27 12:11
testBasic_getDocTypeDeclaration.phpt
1.48
KB
-rw-rw-rw-
2016-01-27 12:11
testBasic_getXmlDeclaration.phpt
1.14
KB
-rw-rw-rw-
2016-01-27 12:11
testBasic_isValidName.phpt
1.38
KB
-rw-rw-rw-
2016-01-27 12:11
testBasic_raiseError.phpt
502
B
-rw-rw-rw-
2016-01-27 12:11
testBasic_replaceEntities.phpt
3.17
KB
-rw-rw-rw-
2016-01-27 12:11
testBasic_reverseEntities.phpt
3.16
KB
-rw-rw-rw-
2016-01-27 12:11
testBasic_splitQualifiedName.phpt
983
B
-rw-rw-rw-
2016-01-27 12:11
testBug_18343.phpt
3.14
KB
-rw-rw-rw-
2016-01-27 12:11
testBug_4950.phpt
675
B
-rw-rw-rw-
2016-01-27 12:11
testBug_5392.phpt
1.07
KB
-rw-rw-rw-
2016-01-27 12:11
Save
Rename
<?php /* vim: set expandtab tabstop=4 shiftwidth=4: */ // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 2004 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 3.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available through the world-wide-web at the following url: | // | http://www.php.net/license/3_0.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | license@php.net so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Author: Bertrand Mansion <bmansion@mamasam.com> | // +----------------------------------------------------------------------+ // // $Id: Getargs_basic_testcase.php 304307 2010-10-11 11:28:02Z jespino $ if (!defined('PHPUnit_MAIN_METHOD')) { define('PHPUnit_MAIN_METHOD', 'Getargs_Basic_testCase::main'); } require_once 'Console/Getargs.php'; require_once 'PHPUnit/Framework.php'; /** * Unit tests for Console_Getargs package. */ class Getargs_Basic_testCase extends PHPUnit_Framework_TestCase { /** * Runs the test methods of this class. * * @access public * @static */ public static function main() { require_once 'PHPUnit/TextUI/TestRunner.php'; $suite = new PHPUnit_Framework_TestSuite('Getargs_Basic_testCase'); PHPUnit_TextUI_TestRunner::run($suite); } function testFixed1() { $config = array( 'name' => array( 'short' => 'n', 'min' => 1, 'max' => 1, 'desc' => 'An argument.') ); $args = array('-n', 'arg1'); $message = implode(' ', $args); $obj =& Console_Getargs::factory($config, $args); if (PEAR::isError($obj)) { $this->fail("'$message' ".$obj->getMessage()); } else { $this->assertEquals($args[1], $obj->getValue('n'), "'$message' Incorrect value returned"); } $args = array('--name', 'arg1'); $message = implode(' ', $args); $obj =& Console_Getargs::factory($config, $args); if (PEAR::isError($obj)) { $this->fail("'$message' ".$obj->getMessage()); } else { $this->assertEquals($args[1], $obj->getValue('name'), "'$message' Incorrect value returned"); } } function testFixed2() { $config = array( 'name' => array( 'short' => 'n', 'min' => 2, 'max' => 2, 'desc' => 'Two arguments.') ); $args = array('-n', 'arg1', 'arg2'); $message = implode(' ', $args); $obj =& Console_Getargs::factory($config, $args); if (PEAR::isError($obj)) { $this->fail("'$message' ".$obj->getMessage()); } else { $this->assertEquals(array($args[1], $args[2]), $obj->getValue('n'), "'$message' Incorrect value returned"); } $args = array('--name', 'arg1', 'arg2'); $message = implode(' ', $args); $obj =& Console_Getargs::factory($config, $args); if (PEAR::isError($obj)) { $this->fail("'$message' ".$obj->getMessage()); } else { $this->assertEquals(array($args[1], $args[2]), $obj->getValue('name'), "'$message' Incorrect value returned"); } } function testFixed1WithDefault() { $config = array( 'name' => array( 'min' => 1, 'max' => 1, 'desc' => 'Fixed number with default value if not used.', 'default' => 'default1') ); $args = array('--name', 'arg1'); $message = implode(' ', $args); $obj =& Console_Getargs::factory($config, $args); if (PEAR::isError($obj)) { $this->fail("'$message' ".$obj->getMessage()); } else { $this->assertEquals($args[1], $obj->getValue('name'), "'$message' Incorrect value returned"); } $args = array(); $obj =& Console_Getargs::factory($config, $args); if (PEAR::isError($obj)) { $this->fail($obj->getMessage()); } else { $this->assertEquals('default1', $obj->getValue('name'), "Incorrect value returned"); } } function testFixed2WithDefault() { $config = array( 'names' => array( 'min' => 2, 'max' => 2, 'desc' => 'Fixed number with default values if not used.', 'default' => array('default1', 'default2')) ); $args = array('--names', 'arg1', 'arg2'); $message = implode(' ', $args); $obj =& Console_Getargs::factory($config, $args); if (PEAR::isError($obj)) { $this->fail("'$message' ".$obj->getMessage()); } else { $this->assertEquals(array($args[1], $args[2]), $obj->getValue('names'), "'$message' Incorrect value returned"); } $args = array(); $obj =& Console_Getargs::factory($config, $args); if (PEAR::isError($obj)) { $this->fail($obj->getMessage()); } else { $this->assertEquals(array('default1', 'default2'), $obj->getValue('names'), "Incorrect value returned"); } } function testSwitch() { $config = array( 'switch' => array( 'short' => 's', 'max' => 0, 'desc' => 'A switch.') ); $args = array('-s'); $message = implode(' ', $args); $obj =& Console_Getargs::factory($config, $args); if (PEAR::isError($obj)) { $this->fail("'$message' ".$obj->getMessage()); } else { $this->assertTrue($obj->isDefined('s'), "'$message' Switch not defined"); $this->assertTrue($obj->isDefined('switch'), "'$message' Switch not defined"); } $args = array('--switch'); $message = implode(' ', $args); $obj =& Console_Getargs::factory($config, $args); if (PEAR::isError($obj)) { $this->fail("'$message' ".$obj->getMessage()); } else { $this->assertTrue($obj->isDefined('s'), "'$message' Switch not defined"); $this->assertTrue($obj->isDefined('switch'), "'$message' Switch not defined"); } } function testSwitchWithDefaultIfValueNotSet() { $config = array( 'default' => array( 'short' => 'd', 'min' => 0, 'max' => 1, 'desc' => 'A switch with a default value if no value set.', 'default' => 3) ); $args = array('-d'); $message = implode(' ', $args); $obj =& Console_Getargs::factory($config, $args); if (PEAR::isError($obj)) { $this->fail("'$message' ".$obj->getMessage()); } else { $this->assertEquals(3, $obj->getValue('d'), "'$message' Incorrect value returned"); $this->assertEquals(3, $obj->getValue('default'), "'$message' Incorrect value returned"); } $args = array('-d', 4); $message = implode(' ', $args); $obj =& Console_Getargs::factory($config, $args); if (PEAR::isError($obj)) { $this->fail("'$message' ".$obj->getMessage()); } else { $this->assertEquals(4, $obj->getValue('d'), "'$message' Incorrect value returned"); $this->assertEquals(4, $obj->getValue('default'), "'$message' Incorrect value returned"); } } function testVariable1_3() { $config = array( 'name' => array( 'min' => 1, 'max' => 3, 'desc' => 'One to three values.') ); $args = array('--name', 'arg1'); $message = implode(' ', $args); $obj =& Console_Getargs::factory($config, $args); if (PEAR::isError($obj)) { $this->fail("'$message' ".$obj->getMessage()); } else { $this->assertEquals('arg1', $obj->getValue('name'), "'$message' Incorrect value returned"); } $args = array('--name', 'arg1', 'arg2', 'arg3'); $message = implode(' ', $args); $obj =& Console_Getargs::factory($config, $args); if (PEAR::isError($obj)) { $this->fail("'$message' ".$obj->getMessage()); } else { $this->assertEquals(array('arg1', 'arg2', 'arg3'), $obj->getValue('name'), "'$message' Incorrect values returned"); } } function testVariable1_3WithDefault() { // TODO : using min => 0 should maybe work too $config = array( 'name' => array( 'min' => 1, 'max' => 3, 'desc' => 'Zero to three values using default if no values set.', 'default' => 'default1') ); $args = array('--name', 'arg1'); $message = implode(' ', $args); $obj =& Console_Getargs::factory($config, $args); if (PEAR::isError($obj)) { $this->fail("'$message' ".$obj->getMessage()); } else { $this->assertEquals('arg1', $obj->getValue('name'), "'$message' Incorrect value returned"); } $args = array('--name', 'arg1', 'arg2', 'arg3'); $message = implode(' ', $args); $obj =& Console_Getargs::factory($config, $args); if (PEAR::isError($obj)) { $this->fail("'$message' ".$obj->getMessage()); } else { $this->assertEquals(array('arg1', 'arg2', 'arg3'), $obj->getValue('name'), "'$message' Incorrect values returned"); } $args = array(); $obj =& Console_Getargs::factory($config, $args); if (PEAR::isError($obj)) { $this->fail($obj->getMessage()); } else { $this->assertEquals('default1', $obj->getValue('name'), "'$message' Incorrect values returned"); } } function testNoLimit() { $config = array( 'name' => array( 'min' => 1, 'max' => -1, 'desc' => 'Unlimited number of values.') ); $args = array('--name', 'arg1'); $message = implode(' ', $args); $obj =& Console_Getargs::factory($config, $args); if (PEAR::isError($obj)) { $this->fail("'$message' ".$obj->getMessage()); } else { $this->assertEquals('arg1', $obj->getValue('name'), "'$message' Incorrect value returned"); } $args = array('--name', 'arg1', 'arg2', 'arg3'); $message = implode(' ', $args); $obj =& Console_Getargs::factory($config, $args); if (PEAR::isError($obj)) { $this->fail($obj->getMessage()); } else { $this->assertEquals(array('arg1', 'arg2', 'arg3'), $obj->getValue('name'), "'$message' Incorrect values returned"); } } function testNoLimitWithDefault() { $config = array( 'name' => array( 'min' => 1, 'max' => -1, 'desc' => 'Unlimited number of values.', 'default' => 'default1') ); $args = array(); $obj =& Console_Getargs::factory($config, $args); if (PEAR::isError($obj)) { $this->fail($obj->getMessage()); } else { $this->assertEquals('default1', $obj->getValue('name'), "Incorrect values returned"); } } function testAlias() { $config = array( 'name|alias' => array( 'short' => 'n|a', 'min' => 0, 'max' => 0, 'desc' => 'Unlimited number of values with alias.') ); $args = array('-n', '-a', '--name', '--alias'); foreach ($args as $arg) { $message = $arg; $obj =& Console_Getargs::factory($config, array($arg)); if (PEAR::isError($obj)) { $this->fail($obj->getMessage()); } else { $this->assertTrue($obj->isDefined('name'), "Value 'name' is not defined"); $this->assertTrue($obj->isDefined('alias'), "Value 'alias' is not defined"); $this->assertTrue($obj->isDefined('n'), "Value 'n' is not defined"); $this->assertTrue($obj->isDefined('a'), "Value 'a' is not defined"); } } } /** * isDefined should return true when the parameter is passed on cmdline */ function testIsDefined() { $config = array( 'name' => array( 'short' => 'n', 'min' => 1, 'max' => 1, 'desc' => 'An argument.', 'default' => 'john' ) ); $args = array('-n', 'arg1'); $obj =& Console_Getargs::factory($config, $args); $this->assertFalse(PEAR::isError($obj)); $this->assertTrue($obj->isDefined('n')); $this->assertTrue($obj->isDefined('name')); } /** * isDefined should return true when the parameter is passed on cmdline, * even when checking for the alias name */ function testIsDefinedAlias() { $config = array( 'name|alias' => array( 'short' => 'n', 'min' => 1, 'max' => 1, 'desc' => 'An argument.', 'default' => 'john' ) ); $args = array('-n', 'arg1'); $obj =& Console_Getargs::factory($config, $args); $this->assertFalse(PEAR::isError($obj)); $this->assertTrue($obj->isDefined('n')); $this->assertTrue($obj->isDefined('name')); $this->assertTrue($obj->isDefined('alias')); } /** * isDefined should return false when the parameter is not * given on cmdline - even if there is a default value */ function testIsDefinedDefaultOnly() { $config = array( 'name' => array( 'short' => 'n', 'min' => 1, 'max' => 1, 'desc' => 'An argument.', 'default' => 'john' ) ); $args = array(); $obj =& Console_Getargs::factory($config, $args); $this->assertFalse(PEAR::isError($obj)); $this->assertFalse($obj->isDefined('n')); $this->assertFalse($obj->isDefined('name')); } } if (PHPUnit_MAIN_METHOD == 'Getargs_Basic_testCase::main') { Getargs_Basic_testCase::main(); } ?>