FOSSology  4.4.0
Open Source License Compliance by Open Source Software
ObligationTest.php
Go to the documentation of this file.
1 <?php
2 /*
3  SPDX-FileCopyrightText: © 2021 Siemens AG
4  Author: Gaurav Mishra <mishra.gaurav@siemens.com>
5 
6  SPDX-License-Identifier: GPL-2.0-only
7 */
14 
16 
21 class ObligationTest extends \PHPUnit\Framework\TestCase
22 {
27  public function testDataFormat()
28  {
29  $expectedObligation = [
30  'id' => 123,
31  'topic' => 'My obligation',
32  'type' => 'Obligation',
33  'text' => 'This should represent some valid obligation text.',
34  'classification' => 'yellow',
35  'comment' => ""
36  ];
37 
38  $actualObligation = new Obligation("123", 'My obligation', 'Obligation',
39  'This should represent some valid obligation text.', 'yellow');
40 
41  $this->assertEquals($expectedObligation, $actualObligation->getArray());
42  }
43 }