コード例 #1
0
 public function testAddsNumbers()
 {
     $addition = new Addition();
     $result = $addition->run(5, 5);
     $this->assertSame(10, $result);
 }
コード例 #2
0
ファイル: AdditionTest.php プロジェクト: theki/Calculator
 public function testCalculate()
 {
     $add = new Addition();
     $this->assertEquals(3, $add->calculate(2, 1));
     $this->assertEquals(-1, $add->calculate(4, -5));
 }
コード例 #3
0
ファイル: AdditionTest.php プロジェクト: taluu/totem
 public function testNew()
 {
     $this->assertSame('new', $this->change->getNew());
 }
コード例 #4
0
 public function testFindsTheSumOfNumbers()
 {
     $addition = new Addition();
     $sum = $addition->run(5, 0);
     $this->assertEquals(5, $sum);
 }
コード例 #5
0
ファイル: object_classes.php プロジェクト: anamwp/jw-oop
        $this->name = 'This is a string';
        echo $this->name . '<br>';
    }
    /**
     * Addition Function
     * show below how to call
     * and use them
     * @param $a
     * @param $b
     */
    function add_function($a, $b)
    {
        $c = $a + $b;
        echo $c;
    }
}
?>

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <?php 
$add = new Addition();
$add->add_function(2, 3);
?>
</body>
</html>
コード例 #6
0
ファイル: Comment.php プロジェクト: TheDenisNovikov/teacher
 public function additions()
 {
     return Addition::search()->filterBy('comment', $this)->find();
 }