Skip to content

Commit

Permalink
Corrige les tests unitaires vu la nouvelle année (2021)
Browse files Browse the repository at this point in the history
  • Loading branch information
Donov4n committed Jan 1, 2021
1 parent 37149e4 commit 3053393
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
7 changes: 2 additions & 5 deletions server/tests/endpoints/BillsTest.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<?php
namespace Robert2\Tests;

use Robert2\API\I18n\I18n;
use Robert2\API\Config\Config;

final class BillsTest extends ApiTestCase
{
public function testGetBill()
Expand Down Expand Up @@ -63,7 +60,7 @@ public function testCreateBill()
{
$this->client->post('/api/events/2/bill');
$this->assertStatusCode(SUCCESS_CREATED);
$newBillNumber = sprintf('%s-00002', date('Y'));
$newBillNumber = sprintf('%s-00001', date('Y'));
$this->assertResponseData([
'id' => 2,
'number' => $newBillNumber,
Expand Down Expand Up @@ -114,7 +111,7 @@ public function testCreateBillWithDiscount()
{
$this->client->post('/api/events/2/bill', ['discountRate' => 50.0]);
$this->assertStatusCode(SUCCESS_CREATED);
$newBillNumber = sprintf('%s-00002', date('Y'));
$newBillNumber = sprintf('%s-00001', date('Y'));
$this->assertResponseData([
'id' => 2,
'number' => $newBillNumber,
Expand Down
6 changes: 2 additions & 4 deletions server/tests/models/BillTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

use Robert2\API\Models;
use Robert2\API\Errors;
use Robert2\API\I18n\I18n;
use Robert2\API\Config\Config;

final class BillTest extends ModelTestCase
{
Expand Down Expand Up @@ -159,7 +157,7 @@ public function testCreateFromEventNotFound()
public function testCreateFromEvent()
{
$result = $this->model->createFromEvent(2, 1, 25.9542);
$newBillNumber = sprintf('%s-00002', date('Y'));
$newBillNumber = sprintf('%s-00001', date('Y'));
$expected = [
'id' => 2,
'number' => $newBillNumber,
Expand Down Expand Up @@ -231,6 +229,6 @@ public function testDeleteByNumber()
public function testGetLastBillNumber()
{
$result = $this->model->getLastBillNumber();
$this->assertEquals(1, $result);
$this->assertEquals(0, $result);
}
}

0 comments on commit 3053393

Please sign in to comment.