!C99Shell v. 2.1 [PHP 8 Update] [02.02.2022]!

Software: Apache/2.4.53 (Unix) OpenSSL/1.1.1o PHP/7.4.29 mod_perl/2.0.12 Perl/v5.34.1. PHP/7.4.29 

uname -a: Linux vps-2738122-x 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 

uid=1(daemon) gid=1(daemon) grupos=1(daemon) 

Safe-mode: OFF (not secure)

/opt/lampp/lib/php/test/Math_Vector/tests/   drwxr-xr-x
Free 13.66 GB of 61.93 GB (22.05%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     Math_VectorTest.php (3.47 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
require_once "Math/Vector.php";
require_once 
"Math/Vector2.php";
require_once 
"Math/Vector3.php";

require_once 
'PHPUnit/Framework.php';

class 
Math_VectorTest extends PHPUnit_Framework_TestCase {
    var 
$v;
    var 
$w;
    var 
$z;
    var 
$x;
    var 
$y;
    var 
$a;
    var 
$t;
    var 
$bad;

    function 
setup() {
        
$this->= array(2,3,4);
        
$this->= new Math_Tuple(array(2,6,8));
        
$this->= new Math_Vector($this->a);
        
$this->= new Math_Vector($this->t);
        
$this->= new Math_Vector(new Math_Vector(range(2,5)));
        
$this->= new Math_Vector2(array(1,2));
        
$this->= new Math_Vector3(new Math_Tuple(array(1,0,1)));
        
$this->bad = new Math_Vector("foo");
    }

    
// Vector from array
    
function testFromArray() {
        
$this->assertTrue(Math_VectorOp::isVector($this->v) && $this->v->isValid());
    }

    
//Vector from tuple
    
function testFromTuple() {
        
$this->assertTrue(Math_VectorOp::isVector($this->w) && $this->w->isValid());
    }

    function 
testFromVector() {
        
$this->assertTrue(Math_VectorOp::isVector($this->z) && $this->z->isValid());
    }

    function 
test2DVector() {
        
$this->assertTrue(Math_VectorOp::isVector2($this->y) && $this->y->isValid());
    }

    function 
test3DVector() {
        
$this->assertTrue(Math_VectorOp::isVector3($this->x) && $this->x->isValid());
    }

    function 
testBadVector() {
        
$this->assertTrue(Math_VectorOp::isVector($this->bad) && !$this->bad->isValid());
    }

    function 
testLength() {
        
$l number_format($this->v->length(), 8);
        
$this->assertTrue($l == 5.38516481);
    }

    function 
testToString() {
        
$this->assertTrue($this->v->toString() == "Vector: < 2, 3, 4 >");
    }

    function 
testNormalize() {
        
$this->v->normalize();
        
$this->assertTrue($this->v->length() == 1);
    }

    function 
testReverse() {
        
$this->v->reverse();
        
$this->assertTrue($this->v->toString() == "Vector: < -2, -3, -4 >");
    }

    function 
testTuple() {
        
ob_start();
?>
Creating tuple
Math_Tuple Object
(
    [data] => Array
        (
            [0] => 2
            [1] => 3
            [2] => 4
        )

)
Tuple size: 3
Adding element value 7
Tuple size: 4
Tuple toString: { 2, 3, 4, 7 }
Setting element 1 to 11
Tuple toString: { 2, 11, 4, 7 }
Maximum element value: 11
Minimum element value: 2
Index of maximum value: 1
Index of minimum value: 0
Remove element 2
Tuple toString: { 2, 11, 7 }
Get element 2: 7
Get index of element value 11: 1
<?php
        $expected 
ob_get_clean();

        
ob_start();

        echo 
"Creating tuple\n";
        
$t = new Math_Tuple(array(2,3,4));
        
print_r($t);
        echo 
"Tuple size: ".$t->getSize()."\n";
        echo 
"Adding element value 7\n";
        
$t->addElement(7);
        echo 
"Tuple size: ".$t->getSize()."\n";
        echo 
"Tuple toString: ".$t->toString()."\n";
        echo 
"Setting element 1 to 11\n";
        
$t->setElement(111);
        echo 
"Tuple toString: ".$t->toString()."\n";
        echo 
"Maximum element value: ".$t->getMax()."\n";
        echo 
"Minimum element value: ".$t->getMin()."\n";
        echo 
"Index of maximum value: ".$t->getMaxIndex()."\n";
        echo 
"Index of minimum value: ".$t->getMinIndex()."\n";
        echo 
"Remove element 2\n";
        
$t->delElement(2);
        echo 
"Tuple toString: ".$t->toString()."\n";
        echo 
"Get element 2: ".$t->getElement(2)."\n";
        echo 
"Get index of element value 11: ".$t->getValueIndex(11)."\n";

        
$result ob_get_clean();

        
$this->assertSame($expected$result);

    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.1 [PHP 8 Update] [02.02.2022] maintained byC99Shell Github | Generation time: 0.475 ]--