/** */ public function testSum() { Blueprint::make('Model1', ['int1' => 100, 'str1' => 'testSum']); Blueprint::make('Model1', ['int1' => 10, 'str1' => 'testSum']); $this->assertEquals(220, Model1::sum(['int1', '+', 'int1'], ['str1' => 'testSum'])); }
/** * @depends testSelection */ public function testSum() { $sum = 0; $key = "sumtest"; for ($i = 0; $i < 100; ++$i) { Blueprint::make('Model1', ['str1' => $key, 'int1' => $i]); $sum += $i; } $this->assertEquals($sum, Model1::sum('int1', ['str1' => $key])); }