public function testGetCreated()
 {
     $client = new CaravanaApi('./');
     $response = $client->userInviteStatusApi()->getCreated();
     $this->assertInstanceOf('Caravana\\Core\\Models\\Responses\\UserInviteStatus', $response);
     $this->assertEquals($response->getId(), 1);
     $this->assertEquals($response->getName(), 'Created');
 }
 public function testUnitedStates()
 {
     $client = new CaravanaApi('./');
     $response = $client->countryApi()->getUnitedStates();
     $this->assertInstanceOf('Caravana\\Core\\Models\\Responses\\Country', $response);
     $this->assertEquals($response->getId(), CountryDataUtil::getUnitedStatesId());
     $this->assertEquals($response->getName(), 'United States');
 }
Ejemplo n.º 3
0
 public function testGetLocations()
 {
     $client = new CaravanaApi('./');
     $vendorLocations = $client->vendorApi()->getLocations(1);
     foreach ($vendorLocations as $item) {
         $this->assertInstanceOf('Caravana\\Core\\Models\\Responses\\VendorLocation', $item);
     }
 }
 public function testIndex()
 {
     $client = new CaravanaApi('./');
     $response = $client->userInviteApi()->index([]);
     $this->assertInstanceOf('Caravana\\Core\\Models\\Responses\\Collections\\UserInviteCollection', $response);
     foreach ($response->getData() as $item) {
         $this->assertInstanceOf('Caravana\\Core\\Models\\Responses\\UserInvite', $item);
     }
 }
Ejemplo n.º 5
0
 public function testStore()
 {
     $createUserRequest = new CreateUserRequest();
     $createUserRequest->setFirstName('john');
     $createUserRequest->setLastName('doe');
     $password = substr(md5(rand()), 0, 7);
     $createUserRequest->setPassword($password);
     $createUserRequest->setEmail(substr(md5(rand()), 0, 7) . '@whatever.com');
     $client = new CaravanaApi('./');
     $user = $client->userApi()->store($createUserRequest);
     $this->assertInstanceOf('Caravana\\Core\\Models\\Responses\\User', $user);
     $updatePasswordRequest = new UpdatePasswordRequest();
     $updatePasswordRequest->setCurrentPassword($password);
     $updatePasswordRequest->setNewPassword('dl3ladj');
     $updatePasswordResult = $client->userApi()->updatePassword($user->getId(), $updatePasswordRequest);
     $this->assertEquals(null, $updatePasswordResult);
 }
 public function testShow()
 {
     $client = new CaravanaApi('./');
     $result = $client->vehicleModelApi()->show(1);
     $this->assertInstanceOf('Caravana\\Core\\Models\\Responses\\VehicleModel', $result);
 }
 public function testGetDiesel()
 {
     $client = new CaravanaApi('./');
     $response = $client->fuelTypeApi()->getDiesel();
     $this->assertInstanceOf('Caravana\\Core\\Models\\Responses\\FuelType', $response);
 }
 public function testGetManual()
 {
     $client = new CaravanaApi('./');
     $response = $client->transmissionApi()->getManual();
     $this->assertInstanceOf('Caravana\\Core\\Models\\Responses\\Transmission', $response);
 }
 public function testShow()
 {
     $client = new CaravanaApi('./');
     $response = $client->subdivisionApi()->show(1);
     $this->assertInstanceOf('Caravana\\Core\\Models\\Responses\\Subdivision', $response);
 }