/** * Getting a list of all accounts should not fail. * * @return BbObject[] */ public function testGetAll() { $at = getenv("BB_ACCESS_TOKEN"); $objects = AccountGroup::getAll($at); $this->assertContainsOnlyInstancesOf('\\ClausConrad\\BillysBilling\\AccountGroup', $objects, 'Getting all returns only objects of this type.'); return $objects; }
/** * Deleting an object by its ID should not fail. */ public function testDeleteById() { $at = getenv("BB_ACCESS_TOKEN"); $accountGroups = AccountGroup::getAll($at); $accountGroup = $accountGroups[0]; $object = new Account($at, 'newAccountName', $accountGroup->id); $object->save(); Account::deleteById($at, $object->id); }