public function testDoUpdateIfUnmodifiedReturnsTrue()
 {
     $ifUnmodifiedSince = strtotime('2 March 2013');
     $updated_at = strtotime('1 March 2013');
     $request = m::mock('Fideloper\\ConditionalRequest\\Request\\RequestInterface');
     $request->shouldReceive('getIfMatch')->once()->andReturn(null);
     $request->shouldReceive('getIfUnmodifiedSince')->once()->andReturn(new DateTime('@' . $ifUnmodifiedSince));
     $request->shouldReceive('attemptedEtag')->once()->andReturn(false);
     $conditional = new Conditional($request);
     $conditional->setLastModified(new DateTime('@' . $updated_at), 'If Unmodified Since returns True, as it was not modified since date given');
     // True - do update
     $this->assertTrue($conditional->doUpdate());
 }
 public function testDoGetReturnsTrueBecauseEtagAttemptedButInvalid()
 {
     $ifModifiedSince = strtotime('2 March 2013');
     $updated_at = strtotime('1 March 2013');
     $request = m::mock('Fideloper\\ConditionalRequest\\Request\\RequestInterface');
     $request->shouldReceive('getIfNoneMatch')->once()->andReturn(array());
     $request->shouldReceive('getIfModifiedSince')->once()->andReturn(new DateTime('@' . $ifModifiedSince));
     $request->shouldReceive('attemptedEtag')->once()->andReturn(true);
     $conditional = new Conditional($request);
     $conditional->setLastModified(new DateTime('@' . $updated_at));
     // Updated before ifModifiedSince
     $this->assertTrue($conditional->doGet(), 'ETag and If Modified Since both used. ETag has no match, but we still ignore If Modified Since');
 }