api-erstellen #1

Merged
TorstenHettstedt merged 52 commits from api-erstellen into master 2021-04-07 13:00:46 +02:00
Showing only changes of commit 9e35ab3b07 - Show all commits
@@ -44,16 +44,16 @@ class WorkingHoursViewControllerTest extends Unit
} }
TorstenHettstedt marked this conversation as resolved
Review

Zur Vereinfachung der Klasse soolte es den folgenden Test geben:

    /**
     * @throws NotDatabasesException
     * @throws Exception
     */
    public function testConstructWithNonDatabase(): void
    {
        $this->container = $this->makeEmpty(ContainerInterface::class, [
            'has' => false
        ]);
        $this->expectException(NotDatabasesException::class);
        new WorkingHoursViewController($this->container);
    }
Zur Vereinfachung der Klasse soolte es den folgenden Test geben: ``` /** * @throws NotDatabasesException * @throws Exception */ public function testConstructWithNonDatabase(): void { $this->container = $this->makeEmpty(ContainerInterface::class, [ 'has' => false ]); $this->expectException(NotDatabasesException::class); new WorkingHoursViewController($this->container); } ```
/** /**
* @throws NotDatabasesException
* @throws Exception * @throws Exception
*/ */
TorstenHettstedt marked this conversation as resolved
Review

Eine fehlende Datenbank sollte schon in der Erstellung des Objektes einen Fehler auslösen.

Eine fehlende Datenbank sollte schon in der Erstellung des Objektes einen Fehler auslösen.
public function testBrowseMonthlyWithNonDatabase(): void public function testConstructWithNonDatabase(): void
{ {
$this->container = $this->makeEmpty(ContainerInterface::class, [ $this->container = $this->makeEmpty(ContainerInterface::class, [
'has' => false 'has' => false
]); ]);
$controller = new WorkingHoursViewController($this->container);
$this->expectException(NotDatabasesException::class); $this->expectException(NotDatabasesException::class);
$controller->browseMonthly($this->request, $this->response, []); new WorkingHoursViewController($this->container);
} }
/** /**
@@ -66,19 +66,6 @@ class WorkingHoursViewControllerTest extends Unit
$this->assertInstanceOf(Response::class, $response); $this->assertInstanceOf(Response::class, $response);
} }
/**
* @throws Exception
*/
public function testBrowseYearlyWithNonDatabase(): void
{
$this->container = $this->makeEmpty(ContainerInterface::class, [
'has' => false
]);
$controller = new WorkingHoursViewController($this->container);
$this->expectException(NotDatabasesException::class);
$controller->browseYearly($this->request, $this->response, []);
}
/** /**
* @throws Exception * @throws Exception
*/ */
1
@@ -89,19 +76,6 @@ class WorkingHoursViewControllerTest extends Unit
$this->assertInstanceOf(Response::class, $response); $this->assertInstanceOf(Response::class, $response);
} }
/**
* @throws Exception
*/
public function testBrowseWeeklyWithNonDatabase(): void
{
$this->container = $this->makeEmpty(ContainerInterface::class, [
'has' => false
]);
$controller = new WorkingHoursViewController($this->container);
$this->expectException(NotDatabasesException::class);
$controller->browseWeekly($this->request, $this->response, []);
}
/** /**
* @throws Exception * @throws Exception
*/ */