Ignore:
Timestamp:
Sep 21, 2017, 1:59:48 PM (9 years ago)
Author:
Joachim Langenbach <joachim.langenbach@…>
Branches:
debian/bullseye, debian/jessie
Children:
6b3dd00
Parents:
949f66d (diff), 3145648 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:
  • Merge branch 'master' into debian/jessie
  • Adapted debian files
    • control
      • python packages are architecture all now (thanks to Herbert)
      • added gpsbabel as runtime dependency for gnuboat (gnuboat-log-converter needs it to create GPX files)
    • source/options: Ignores egg-info now
Location:
src/webapp/webservice/tests
Files:
7 added
1 edited

Legend:

Unmodified
Added
Removed
  • src/webapp/webservice/tests/ServiceTest.php

    r949f66d r944372e  
    2020// declare(Strict_types=1);
    2121
     22namespace GnuBoat;
     23
    2224/**
    23   * @brief Covers index.php tests
     25  * @brief Covers Service.php tests
    2426  */
    25 final class ServiceTest extends PHPUnit_Framework_TestCase
     27final class ServiceTest extends \PHPUnit_Framework_TestCase
    2628{
    27         /**
    28           * @runInSeparateProcess
    29           */
    3029        public function testData()
    3130        {
    32                 $webservice = new GnuBoat\Webservice();
    33                 $this->assertInstanceOf(GnuBoat\Webservice::class, $webservice);
    34                 $_POST["request"] = "data";
     31                $webservice = new Webservice(0);
     32                $this->assertInstanceOf(Webservice::class, $webservice);
     33                $_GET["request"] = "data";
    3534                $webservice->process();
    3635        }
    3736
    38         /**
    39           * @runInSeparateProcess
    40           */
    4137        public function testLogFiles()
    4238        {
    43                 $webservice = new GnuBoat\Webservice();
    44                 $this->assertInstanceOf(GnuBoat\Webservice::class, $webservice);
    45                 $_POST["request"] = "logfiles";
     39                $webservice = new Webservice(0);
     40                $this->assertInstanceOf(Webservice::class, $webservice);
     41                $_GET["request"] = "logfiles";
    4642                $webservice->process();
    4743        }
    4844       
    49         /**
    50           * @runInSeparateProcess
    51           */
    5245        public function testShutdown()
    5346        {
    54                 $webservice = new GnuBoat\Webservice();
    55                 $this->assertInstanceOf(GnuBoat\Webservice::class, $webservice);
    56                 $_POST["request"] = "shutdown";
     47                $webservice = new Webservice(0);
     48                $this->assertInstanceOf(Webservice::class, $webservice);
     49                $_GET["request"] = "shutdown";
    5750                $webservice->process();
    5851        }
    59        
    60         /**
    61           * @runInSeparateProcess
    62           */
     52
    6353        public function testMap()
    6454        {
    65                 $webservice = new GnuBoat\Webservice();
    66                 $this->assertInstanceOf(GnuBoat\Webservice::class, $webservice);
    67                 $_POST["request"] = "map";
     55                $webservice = new Webservice(0);
     56                $this->assertInstanceOf(Webservice::class, $webservice);
     57                $_GET["request"] = "map";
    6858                $webservice->process();
     59        }
     60
     61        public function testReplay()
     62        {
     63                $webservice = new Webservice(0);
     64                $_GET["request"] = "replay";
     65                $_POST["logfile"] = "replay-test.log";
     66                $webservice->process();
     67                $output = $this->getActualOutput();
     68                $this->assertJsonStringEqualsJsonString('{"track":{"1503767412":{"latitude":10.001,"longitude":1.001,"speedthroughwater":"-","speedoverground":11,"courseoverground":21,"waterdepth":"-","watertemperature":"-","gpsfix":"-"},"1503767413":{"latitude":20.002,"longitude":2.002,"speedthroughwater":"-","speedoverground":12,"courseoverground":22,"waterdepth":"-","watertemperature":"-","gpsfix":"-"},"1503767414":{"latitude":30.003,"longitude":3.003,"speedthroughwater":"-","speedoverground":13,"courseoverground":23,"waterdepth":1,"watertemperature":21,"gpsfix":"-"},"1503767415":{"latitude":40.004,"longitude":4.004,"speedthroughwater":"-","speedoverground":14,"courseoverground":24,"waterdepth":2,"watertemperature":22,"gpsfix":"-"},"1503767416":{"latitude":50.005,"longitude":5.005,"speedthroughwater":"-","speedoverground":15,"courseoverground":25,"waterdepth":3,"watertemperature":23,"gpsfix":"-"}}}', $output);
    6969        }
    7070}
    7171
     72function error_log($msg)
     73{
     74        echo "ERR GnuBoat: ". $msg ."\n";
     75}
     76
    7277?>
Note: See TracChangeset for help on using the changeset viewer.