Skip to content

Commit 7423eef

Browse files
committed
fixed tests
1 parent 6978942 commit 7423eef

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

src/PHPixie/ORM/Values/Preload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function addPath($path, $options = array())
3737
return $this->addExplodedPath($path, $options);
3838
}
3939

40-
public function addExplodedPath($explodedPath, $options)
40+
public function addExplodedPath($explodedPath, $options = array())
4141
{
4242
$propertyName = array_shift($explodedPath);
4343
$property = $this->getProperty($propertyName);

src/PHPixie/ORM/Values/Preload/Property.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class Property
77
protected $options;
88
protected $parameters;
99

10-
public function __construct($propertyName, $options)
10+
public function __construct($propertyName, $options = array())
1111
{
1212
$this->propertyName = $propertyName;
1313
$this->options = $options;

src/PHPixie/ORM/Values/Preload/Property/Cascading.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class Cascading extends \PHPixie\ORM\Values\Preload\Property
66
{
77
protected $preload;
88

9-
public function __construct($propertyName, $preload, $options)
9+
public function __construct($propertyName, $preload, $options = array())
1010
{
1111
parent::__construct($propertyName, $options);
1212
$this->preload = $preload;

tests/PHPixie/Tests/ORM/Relationships/Type/ManyToMany/PreloaderTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ protected function prepareMap($type = 'left')
3939
$itemKey = $this->configData[$type.'PivotKey'];
4040

4141
$fields = array();
42+
$allIds = [];
4243
foreach($this->map as $ownerId => $ids) {
4344
foreach($ids as $id) {
45+
$allIds[$id] = true;
4446
$fields[] = array(
4547
$ownerKey => $ownerId,
4648
$itemKey => $id,
@@ -49,7 +51,8 @@ protected function prepareMap($type = 'left')
4951
}
5052

5153
$this->method($this->pivotResult, 'getFields', $fields, array(array($ownerKey, $itemKey)), 0);
52-
$this->prepareMapIdOffsets();
54+
$this->method($this->result, 'getField', array_keys($allIds), array('id'), 0);
55+
$this->prepareMapIdOffsets(1);
5356

5457
}
5558

tests/PHPixie/Tests/ORM/Values/PreloadTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ protected function prepareAddTest($path, $property = null)
9393

9494
if($property === null) {
9595
$property = $this->getCascadingProperty($name);
96-
$this->method($this->values, 'cascadingPreloadProperty', $property, array($name), 0);
96+
$this->method($this->values, 'cascadingPreloadProperty', $property, array($name, array()), 0);
9797
}
9898

9999
if(!empty($path)) {
100-
$this->method($property->preload(), 'addExplodedPath', null, array($path), 0);
100+
$this->method($property->preload(), 'addExplodedPath', null, array($path, array()), 0);
101101
}
102102

103103
return $property;

0 commit comments

Comments
 (0)