source: src/webapp/apigility/module/Application/test/Controller/IndexControllerTest.php@ cb39a77

debian/bullseye
Last change on this file since cb39a77 was 74c3571, checked in by Joachim Langenbach <joachim.langenbach@…>, 8 years ago

Added gnuboat_mapservice:

it is a REST webservice designed with Apigility to allow the user to upload data, create waters and so on

  • Property mode set to 100644
File size: 1.7 KB
Line 
1<?php
2/**
3 * @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
4 * @copyright Copyright (c) 2016 Zend Technologies USA Inc. (http://www.zend.com)
5 */
6
7namespace ApplicationTest\Controller;
8
9use Application\Controller\IndexController;
10use Zend\Stdlib\ArrayUtils;
11use Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase;
12
13class IndexControllerTest extends AbstractHttpControllerTestCase
14{
15 public function setUp()
16 {
17 // The module configuration should still be applicable for tests.
18 // You can override configuration here with test case specific values,
19 // such as sample view templates, path stacks, module_listener_options,
20 // etc.
21 $configOverrides = [
22 'module_listener_options' => [
23 'config_cache_enabled' => false,
24 ],
25 ];
26
27 $this->setApplicationConfig(ArrayUtils::merge(
28 include __DIR__ . '/../../../../config/application.config.php',
29 $configOverrides
30 ));
31
32 parent::setUp();
33 }
34
35 public function testIndexActionCanBeAccessed()
36 {
37 $this->dispatch('/', 'GET');
38 $this->assertResponseStatusCode(200);
39 $this->assertModuleName('application');
40 $this->assertControllerName(IndexController::class); // as specified in router's controller name alias
41 $this->assertControllerClass('IndexController');
42 $this->assertMatchedRouteName('home');
43 }
44
45 public function testIndexActionViewModelTemplateRenderedWithinLayout()
46 {
47 $this->dispatch('/', 'GET');
48 $this->assertQuery('.hero-unit');
49 }
50
51 public function testInvalidRouteDoesNotCrash()
52 {
53 $this->dispatch('/invalid/route', 'GET');
54 $this->assertResponseStatusCode(404);
55 }
56}
Note: See TracBrowser for help on using the repository browser.