KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.62
System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64
User : www ( 80)
PHP Version : 8.3.8
Disable Function : NONE
Directory :  /domains/irtiweb/CATS/lib/simpletest/test/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /domains/irtiweb/CATS/lib/simpletest/test/shell_test.php
<?php
// $Id: shell_test.php 1748 2008-04-14 01:50:41Z lastcraft $
require_once(dirname(__FILE__) . '/../autorun.php');
require_once(dirname(__FILE__) . '/../shell_tester.php');

class TestOfShell extends UnitTestCase {
    
    function testEcho() {
        $shell = new SimpleShell();
        $this->assertIdentical($shell->execute('echo Hello'), 0);
        $this->assertPattern('/Hello/', $shell->getOutput());
    }
    
    function testBadCommand() {
        $shell = new SimpleShell();
        $this->assertNotEqual($ret = $shell->execute('blurgh! 2>&1'), 0);
    }
}

class TestOfShellTesterAndShell extends ShellTestCase {
    
    function testEcho() {
        $this->assertTrue($this->execute('echo Hello'));
        $this->assertExitCode(0);
        $this->assertoutput('Hello');
    }
    
    function testFileExistence() {
        $this->assertFileExists(dirname(__FILE__) . '/all_tests.php');
        $this->assertFileNotExists('wibble');
    }
    
    function testFilePatterns() {
        $this->assertFilePattern('/all[_ ]tests/i', dirname(__FILE__) . '/all_tests.php');
        $this->assertNoFilePattern('/sputnik/i', dirname(__FILE__) . '/all_tests.php');
    }
}
?>

Anon7 - 2021