Skip to content

Commit 2503e85

Browse files
committed
Fix tests
1 parent 3651bb0 commit 2503e85

File tree

4 files changed

+14
-87
lines changed

4 files changed

+14
-87
lines changed

features/main/subresource.feature

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ Feature: Subresource support
1212
And the JSON should be equal to:
1313
"""
1414
{
15-
"@context": "/contexts/Answer",
16-
"@id": "/answers/1",
17-
"@type": "Answer",
18-
"id": 1,
19-
"content": "42",
20-
"question": "/questions/1"
15+
"@context": "\/contexts\/Answer",
16+
"@id": "\/answers\/1",
17+
"@type": "Answer",
18+
"id": 1,
19+
"content": "42",
20+
"question": "\/questions\/1"
2121
}
2222
"""
2323

tests/Fixtures/TestBundle/Entity/DummyAggregateOffer.php

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use ApiPlatform\Core\Annotation\ApiProperty;
1717
use ApiPlatform\Core\Annotation\ApiResource;
1818
use Doctrine\Common\Collections\ArrayCollection;
19+
use Doctrine\Common\Collections\Collection;
1920
use Doctrine\ORM\Mapping as ORM;
2021

2122
/**
@@ -58,61 +59,31 @@ public function __construct()
5859
$this->offers = new ArrayCollection();
5960
}
6061

61-
/**
62-
* Get offers.
63-
*
64-
* @return offers
65-
*/
66-
public function getOffers(): ArrayCollection
62+
public function getOffers(): Collection
6763
{
6864
return $this->offers;
6965
}
7066

71-
/**
72-
* Set offers.
73-
*
74-
* @param offers the value to set
75-
*/
7667
public function setOffers($offers)
7768
{
7869
$this->offers = $offers;
7970
}
8071

81-
/**
82-
* Add offer.
83-
*
84-
* @param offer the value to add
85-
*/
8672
public function addOffer(DummyOffer $offer)
8773
{
8874
$this->offers->add($offer);
8975
}
9076

91-
/**
92-
* Get id.
93-
*
94-
* @return id
95-
*/
96-
public function getId(): int
77+
public function getId()
9778
{
9879
return $this->id;
9980
}
10081

101-
/**
102-
* Get value.
103-
*
104-
* @return value
105-
*/
10682
public function getValue(): int
10783
{
10884
return $this->value;
10985
}
11086

111-
/**
112-
* Set value.
113-
*
114-
* @param value the value to set
115-
*/
11687
public function setValue(int $value)
11788
{
11889
$this->value = $value;

tests/Fixtures/TestBundle/Entity/DummyOffer.php

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,31 +43,16 @@ class DummyOffer
4343
*/
4444
private $value;
4545

46-
/**
47-
* Get id.
48-
*
49-
* @return id
50-
*/
51-
public function getId(): int
46+
public function getId()
5247
{
5348
return $this->id;
5449
}
5550

56-
/**
57-
* Get value.
58-
*
59-
* @return value
60-
*/
6151
public function getValue(): int
6252
{
6353
return $this->value;
6454
}
6555

66-
/**
67-
* Set value.
68-
*
69-
* @param value the value to set
70-
*/
7156
public function setValue(int $value)
7257
{
7358
$this->value = $value;

tests/Fixtures/TestBundle/Entity/DummyProduct.php

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use ApiPlatform\Core\Annotation\ApiProperty;
1717
use ApiPlatform\Core\Annotation\ApiResource;
1818
use Doctrine\Common\Collections\ArrayCollection;
19+
use Doctrine\Common\Collections\Collection;
1920
use Doctrine\ORM\Mapping as ORM;
2021

2122
/**
@@ -39,7 +40,7 @@ class DummyProduct
3940
private $id;
4041

4142
/**
42-
* @var ArrayCollection
43+
* @var Collection
4344
*
4445
* @ApiProperty(subresource=true)
4546
* @ORM\OneToMany(targetEntity="DummyAggregateOffer", mappedBy="id", cascade={"persist"})
@@ -58,61 +59,31 @@ public function __construct()
5859
$this->offers = new ArrayCollection();
5960
}
6061

61-
/**
62-
* Get offers.
63-
*
64-
* @return offers
65-
*/
66-
public function getOffers(): ArrayCollection
62+
public function getOffers(): Collection
6763
{
6864
return $this->offers;
6965
}
7066

71-
/**
72-
* Set offers.
73-
*
74-
* @param offers the value to set
75-
*/
7667
public function setOffers($offers)
7768
{
7869
$this->offers = $offers;
7970
}
8071

81-
/**
82-
* Add offer.
83-
*
84-
* @param offer the value to add
85-
*/
8672
public function addOffer(DummyAggregateOffer $offer)
8773
{
8874
$this->offers->add($offer);
8975
}
9076

91-
/**
92-
* Get id.
93-
*
94-
* @return id
95-
*/
96-
public function getId(): int
77+
public function getId()
9778
{
9879
return $this->id;
9980
}
10081

101-
/**
102-
* Get name.
103-
*
104-
* @return name
105-
*/
10682
public function getName(): string
10783
{
10884
return $this->name;
10985
}
11086

111-
/**
112-
* Set name.
113-
*
114-
* @param name the value to set
115-
*/
11687
public function setName($name)
11788
{
11889
$this->name = $name;

0 commit comments

Comments
 (0)