Pinq\Tests\Integration\Expressions\ExpressionOperatorTest::testUnaryOperations PHP Метод

testUnaryOperations() публичный Метод

public testUnaryOperations ( )
    public function testUnaryOperations()
    {
        $four = 4;
        $this->assertSame(~4, Unary::doUnaryOperation(Unary::BITWISE_NOT, $four));
        $this->assertSame(-4, Unary::doUnaryOperation(Unary::NEGATION, $four));
        $this->assertSame(4, Unary::doUnaryOperation(Unary::PLUS, $four));
        $this->assertSame(!4, Unary::doUnaryOperation(Unary::NOT, $four));
        //Affects reference
        $this->assertSame(4, Unary::doUnaryOperation(Unary::INCREMENT, $four));
        $this->assertSame(5, $four);
        $four = 4;
        $this->assertSame(4, Unary::doUnaryOperation(Unary::DECREMENT, $four));
        $this->assertSame(3, $four);
        $four = 4;
        $this->assertSame(5, Unary::doUnaryOperation(Unary::PRE_INCREMENT, $four));
        $this->assertSame(5, $four);
        $four = 4;
        $this->assertSame(3, Unary::doUnaryOperation(Unary::PRE_DECREMENT, $four));
        $this->assertSame(3, $four);
    }