mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for tests
This commit is contained in:
parent
c9eb5750b4
commit
74411da11f
@ -258,17 +258,12 @@ class ClientSettingsTest extends TestCase
|
|||||||
|
|
||||||
$response = false;
|
$response = false;
|
||||||
|
|
||||||
try {
|
$response = $this->withHeaders([
|
||||||
$response = $this->withHeaders([
|
'X-API-SECRET' => config('ninja.api_secret'),
|
||||||
'X-API-SECRET' => config('ninja.api_secret'),
|
'X-API-TOKEN' => $this->token,
|
||||||
'X-API-TOKEN' => $this->token,
|
])->postJson('/api/v1/clients/', $data);
|
||||||
])->post('/api/v1/clients/', $data);
|
|
||||||
} catch (ValidationException $e) {
|
$response->assertStatus(422);
|
||||||
$message = json_decode($e->validator->getMessageBag(), 1);
|
|
||||||
// nlog($message);
|
|
||||||
}
|
|
||||||
|
|
||||||
$response->assertStatus(302);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testClientIllegalPaymenTerms()
|
public function testClientIllegalPaymenTerms()
|
||||||
@ -288,17 +283,13 @@ class ClientSettingsTest extends TestCase
|
|||||||
|
|
||||||
$response = false;
|
$response = false;
|
||||||
|
|
||||||
try {
|
$response = $this->withHeaders([
|
||||||
$response = $this->withHeaders([
|
'X-API-SECRET' => config('ninja.api_secret'),
|
||||||
'X-API-SECRET' => config('ninja.api_secret'),
|
'X-API-TOKEN' => $this->token,
|
||||||
'X-API-TOKEN' => $this->token,
|
])->postJson('/api/v1/clients/', $data);
|
||||||
])->postJson('/api/v1/clients/', $data);
|
|
||||||
} catch (ValidationException $e) {
|
|
||||||
$message = json_decode($e->validator->getMessageBag(), 1);
|
|
||||||
nlog($message);
|
|
||||||
}
|
|
||||||
|
|
||||||
$response->assertStatus(302);
|
|
||||||
|
$response->assertStatus(422);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testClientIllegalValidUntil()
|
public function testClientIllegalValidUntil()
|
||||||
@ -318,17 +309,14 @@ class ClientSettingsTest extends TestCase
|
|||||||
|
|
||||||
$response = false;
|
$response = false;
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $this->withHeaders([
|
$response = $this->withHeaders([
|
||||||
'X-API-SECRET' => config('ninja.api_secret'),
|
'X-API-SECRET' => config('ninja.api_secret'),
|
||||||
'X-API-TOKEN' => $this->token,
|
'X-API-TOKEN' => $this->token,
|
||||||
])->post('/api/v1/clients/', $data);
|
])->postJson('/api/v1/clients/', $data);
|
||||||
} catch (ValidationException $e) {
|
|
||||||
$message = json_decode($e->validator->getMessageBag(), 1);
|
|
||||||
nlog($message);
|
|
||||||
}
|
|
||||||
|
|
||||||
$response->assertStatus(302);
|
|
||||||
|
$response->assertStatus(422);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testClientIllegalDefaultTaskRate()
|
public function testClientIllegalDefaultTaskRate()
|
||||||
@ -381,17 +369,13 @@ class ClientSettingsTest extends TestCase
|
|||||||
|
|
||||||
$response = false;
|
$response = false;
|
||||||
|
|
||||||
try {
|
|
||||||
$response = $this->withHeaders([
|
$response = $this->withHeaders([
|
||||||
'X-API-SECRET' => config('ninja.api_secret'),
|
'X-API-SECRET' => config('ninja.api_secret'),
|
||||||
'X-API-TOKEN' => $this->token,
|
'X-API-TOKEN' => $this->token,
|
||||||
])->post('/api/v1/clients/', $data);
|
])->postJson('/api/v1/clients/', $data);
|
||||||
} catch (ValidationException $e) {
|
|
||||||
$message = json_decode($e->validator->getMessageBag(), 1);
|
|
||||||
nlog($message);
|
|
||||||
}
|
|
||||||
|
|
||||||
$response->assertStatus(302);
|
|
||||||
|
$response->assertStatus(422);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testClientSettingBools()
|
public function testClientSettingBools()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user