public function testSalt() { $decider1 = new Decider($this->seed); $decider2 = new Decider($this->seed); $this->assertEquals($decider1->chooseElement($this->array, 'same salt'), $decider2->chooseElement($this->array, 'same salt'), 'Given same seed and salt Deciders should choose the same element'); $this->assertNotEquals($decider1->chooseElement($this->array, 'not the'), $decider2->chooseElement($this->array, 'same salt'), 'Given the same seed but a different salt Deciders should (probably) choose different elements'); }
public function testParameterOrders() { $decider = new Decider('7704eb6eae8afb62bdcbd26ff1f1437e'); $this->assertEquals($decider->chooseNumber(0, 1000), $decider->chooseNumber(1000), "Calling 'chooseNumber' without a \$lower bound should default it to 0"); $this->assertEquals($decider->chooseNumber(0, 1000, 'salty'), $decider->chooseNumber(1000, 'salty'), "Calling 'chooseNumber' without a \$lower bound but with a salt should default it to 0"); }