예제 #1
0
 function testUpdateThrowsIfInvalidUid()
 {
     $this->expectException('Hypercharge\\Errors\\ValidationError');
     $request = $this->request('scheduler_update.json');
     $this->expect_Curl_jsonRequest()->never();
     Scheduler::update('e1420438c52b', $request);
     // uid too short
 }
 function testUpdate()
 {
     $scheduler = $this->testCreate();
     $uid = $scheduler->unique_id;
     $newAmount = $scheduler->amount + 100;
     $this->mockV2Url(array('scheduler', $uid));
     $s = Scheduler::update($uid, array('amount' => $newAmount));
     $this->assertIdentical($newAmount, $s->amount);
     $s = Scheduler::find($uid);
     $this->assertIdentical($newAmount, $s->amount);
 }