Skip to content

Commit ba1044e

Browse files
committed
test: Updated Test Files
1 parent 90856a6 commit ba1044e

4 files changed

Lines changed: 35 additions & 2106 deletions

File tree

tests/Obj1.php

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,46 @@
11
<?php
22
namespace jsonx\tests;
33

4-
use webfiori\json\JsonI;
5-
use webfiori\json\Json;
4+
use WebFiori\Json\JsonI;
5+
use WebFiori\Json\Json;
66
/**
77
* Description of Obj1
88
*
99
* @author Ibrahim
1010
*/
11-
class Obj1 extends Obj0 implements JsonI {
12-
//put your code here
11+
class Obj1 implements JsonI {
12+
private $prop00;
13+
private $prop01;
14+
private $prop02;
15+
private $prop03;
16+
private $prop04;
17+
public function __construct($prop00='',$prop01='',$prop02='',$prop03='',$prop04='') {
18+
$this->prop00 = $prop00;
19+
$this->prop01 = $prop01;
20+
$this->prop02 = $prop02;
21+
$this->prop03 = $prop03;
22+
$this->prop04 = $prop04;
23+
}
24+
public function getProperty00() {
25+
return $this->prop00;
26+
}
27+
public function getProperty01() {
28+
return $this->prop01;
29+
}
30+
public function getProperty02() {
31+
return $this->prop02;
32+
}
33+
public function getProperty03() {
34+
return $this->prop03;
35+
}
36+
public function getProperty04() {
37+
return $this->prop04;
38+
}
1339
public function toJSON() : Json {
14-
$j = new Json();
15-
$j->add('property-00', $this->getProperty00());
16-
$j->add('property-01', $this->getProperty01());
17-
$j->add('property-02', $this->getProperty02());
18-
19-
return $j;
40+
$json = new Json();
41+
$json->addString('property-00', $this->getProperty00());
42+
$json->addNumber('property-01', $this->getProperty01());
43+
$json->add('property-02', $this->getProperty02());
44+
return $json;
2045
}
2146
}

0 commit comments

Comments
 (0)