FOSSology  4.4.0
Open Source License Compliance by Open Source Software
InfoTest.php
Go to the documentation of this file.
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2020 Siemens AG
4  Author: Gaurav Mishra <mishra.gaurav@siemens.com>
5 
6  SPDX-License-Identifier: GPL-2.0-only
7 */
14 
17 
22 class InfoTest extends \PHPUnit\Framework\TestCase
23 {
28  public function testDataFormat()
29  {
30  $expectedInfo = [
31  'code' => 200,
32  'message' => "All good",
33  'type' => "INFO"
34  ];
35  $expectedError = [
36  'code' => 500,
37  'message' => "Something bad",
38  'type' => "ERROR"
39  ];
40 
41  $actualInfo = new Info(200, "All good", InfoType::INFO);
42  $actualError = new Info(500, "Something bad", InfoType::ERROR);
43 
44  $this->assertEquals($expectedInfo, $actualInfo->getArray());
45  $this->assertEquals($expectedError, $actualError->getArray());
46  }
47 }
Different type of infos provided by REST.
Definition: InfoType.php:16
Info model to contain general error and return values.
Definition: Info.php:19