public function test_createdAt() { $customer = Braintree\Customer::createNoValidate(); $past = clone $customer->createdAt; $past->modify("-1 hour"); $future = clone $customer->createdAt; $future->modify("+1 hour"); $collection = Braintree\Customer::search(array(Braintree\CustomerSearch::id()->is($customer->id), Braintree\CustomerSearch::createdAt()->between($past, $future))); $this->assertEquals(1, $collection->maximumCount()); $this->assertEquals($customer->id, $collection->firstItem()->id); $collection = Braintree\Customer::search(array(Braintree\CustomerSearch::id()->is($customer->id), Braintree\CustomerSearch::createdAt()->lessThanOrEqualTo($future))); $this->assertEquals(1, $collection->maximumCount()); $this->assertEquals($customer->id, $collection->firstItem()->id); $collection = Braintree\Customer::search(array(Braintree\CustomerSearch::id()->is($customer->id), Braintree\CustomerSearch::createdAt()->greaterThanOrEqualTo($past))); $this->assertEquals(1, $collection->maximumCount()); $this->assertEquals($customer->id, $collection->firstItem()->id); }