| [c455d7b] | 1 | <?php
|
|---|
| 2 | /*
|
|---|
| 3 | Copyright (C) 2017 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
|
|---|
| 4 |
|
|---|
| 5 | This program is free software: you can redistribute it and/or modify
|
|---|
| 6 | it under the terms of the GNU General Public License as published by
|
|---|
| 7 | the Free Software Foundation, either version 3 of the License, or
|
|---|
| 8 | (at your option) any later version.
|
|---|
| 9 |
|
|---|
| 10 | This program is distributed in the hope that it will be useful,
|
|---|
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 13 | GNU General Public License for more details.
|
|---|
| 14 |
|
|---|
| 15 | You should have received a copy of the GNU General Public License
|
|---|
| 16 | along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|---|
| 17 | */
|
|---|
| 18 |
|
|---|
| 19 | // enable in php 7
|
|---|
| 20 | // declare(Strict_types=1);
|
|---|
| 21 |
|
|---|
| [008bce9] | 22 | namespace GnuBoat;
|
|---|
| 23 |
|
|---|
| [c455d7b] | 24 | /**
|
|---|
| [008bce9] | 25 | * @brief Covers Service.php tests
|
|---|
| [c455d7b] | 26 | */
|
|---|
| [008bce9] | 27 | final class ServiceTest extends \PHPUnit_Framework_TestCase
|
|---|
| [c455d7b] | 28 | {
|
|---|
| 29 | public function testData()
|
|---|
| 30 | {
|
|---|
| [008bce9] | 31 | $webservice = new Webservice(0);
|
|---|
| 32 | $this->assertInstanceOf(Webservice::class, $webservice);
|
|---|
| [c455d7b] | 33 | $_POST["request"] = "data";
|
|---|
| 34 | $webservice->process();
|
|---|
| 35 | }
|
|---|
| 36 |
|
|---|
| 37 | public function testLogFiles()
|
|---|
| 38 | {
|
|---|
| [008bce9] | 39 | $webservice = new Webservice(0);
|
|---|
| 40 | $this->assertInstanceOf(Webservice::class, $webservice);
|
|---|
| [c455d7b] | 41 | $_POST["request"] = "logfiles";
|
|---|
| 42 | $webservice->process();
|
|---|
| 43 | }
|
|---|
| 44 |
|
|---|
| 45 | public function testShutdown()
|
|---|
| 46 | {
|
|---|
| [008bce9] | 47 | $webservice = new Webservice(0);
|
|---|
| 48 | $this->assertInstanceOf(Webservice::class, $webservice);
|
|---|
| [c455d7b] | 49 | $_POST["request"] = "shutdown";
|
|---|
| 50 | $webservice->process();
|
|---|
| 51 | }
|
|---|
| [0662b2d] | 52 |
|
|---|
| [c455d7b] | 53 | public function testMap()
|
|---|
| 54 | {
|
|---|
| [008bce9] | 55 | $webservice = new Webservice(0);
|
|---|
| 56 | $this->assertInstanceOf(Webservice::class, $webservice);
|
|---|
| [c455d7b] | 57 | $_POST["request"] = "map";
|
|---|
| 58 | $webservice->process();
|
|---|
| 59 | }
|
|---|
| [0662b2d] | 60 |
|
|---|
| [008bce9] | 61 | public function testReplay()
|
|---|
| 62 | {
|
|---|
| 63 | $webservice = new Webservice(0);
|
|---|
| 64 | $this->assertInstanceOf(Webservice::class, $webservice);
|
|---|
| 65 | $_POST["request"] = "replay";
|
|---|
| 66 | $webservice->process();
|
|---|
| 67 | }
|
|---|
| [c455d7b] | 68 | }
|
|---|
| 69 |
|
|---|
| [0662b2d] | 70 | function error_log($msg)
|
|---|
| 71 | {
|
|---|
| 72 | echo "ERR GnuBoat: ". $msg ."\n";
|
|---|
| 73 | }
|
|---|
| [008bce9] | 74 |
|
|---|
| [c455d7b] | 75 | ?>
|
|---|