Skip to content

Commit f6ee1c5

Browse files
absmocaabsmoca
authored andcommitted
Resolve Bugs
1 parent 266d0ec commit f6ee1c5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Leboncoin/Annonce.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ public function __construct($data = null) {
8484
&& isset($data->category_name)
8585
&& isset($data->body)
8686
&& isset($data->url)
87-
&& isset($data->price)
8887
&& isset($data->images)
8988
&& isset($data->location)
9089
&& isset($data->owner)

tests/LeboncoinTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public function testGetAnnoncesOnlyParticuliers() {
3636
$finds = 0;
3737
/* @var $annonce \Absmoca\Annonce */
3838
foreach ($annonces->annonces as $annonce) {
39-
if($annonce->getOwner()["type"] == "pro") $finds =+ 1;
39+
$owner = $annonce->getOwner();
40+
if(!isset($owner["type"]) || $owner["type"] == "pro") $finds++;
4041
}
4142
$this->assertEquals(0, $finds);
4243
}
@@ -51,7 +52,8 @@ public function testGetAnnoncesOnlyPro() {
5152
$finds = 0;
5253
/* @var $annonce \Absmoca\Annonce */
5354
foreach ($annonces->annonces as $annonce) {
54-
if($annonce->getOwner()["type"] == "private") $finds =+ 1;
55+
$owner = $annonce->getOwner();
56+
if(!isset($owner["type"]) || $owner["type"] == "private") $finds++;
5557
}
5658
$this->assertEquals(0, $finds);
5759
}

0 commit comments

Comments
 (0)