Skip to content
This repository has been archived by the owner on Sep 13, 2018. It is now read-only.

Commit

Permalink
Fix missed references to *List
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwathan committed Mar 14, 2015
1 parent d8e1929 commit 09fdf51
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 18 deletions.
14 changes: 2 additions & 12 deletions src/Faktory.php
Expand Up @@ -37,22 +37,12 @@ public function create($name, $attributes = [])

public function buildMany($name, $count, $attributes = [])
{
return $this->getFactory($name)->buildList($count, $attributes);
}

public function buildList($name, $count, $attributes = [])
{
return $this->buildMany($name, $count, $attributes);
return $this->getFactory($name)->buildMany($count, $attributes);
}

public function createMany($name, $count, $attributes = [])
{
return $this->getFactory($name)->createList($count, $attributes);
}

public function createList($name, $count, $attributes = [])
{
return $this->createMany($name, $count, $attributes);
return $this->getFactory($name)->createMany($count, $attributes);
}

public function getFactory($name)
Expand Down
4 changes: 2 additions & 2 deletions src/Relationship/HasMany.php
Expand Up @@ -12,12 +12,12 @@ public function __construct($related_model, $factoryLoader, $quantity, $foreign_

public function build()
{
return $this->factory->buildList($this->quantity, $this->attributes);
return $this->factory->buildMany($this->quantity, $this->attributes);
}

protected function createRelated()
{
return $this->factory->createList($this->quantity, $this->attributes);
return $this->factory->createMany($this->quantity, $this->attributes);
}

public function quantity($quantity)
Expand Down
8 changes: 4 additions & 4 deletions tests/FaktoryBuildTest.php
Expand Up @@ -186,7 +186,7 @@ public function test_can_build_list_of_objects()
$f->name = 'Bark at the moon';
$f->artist = 'Ozzy Osbourne';
});
$albums = $this->faktory->buildList('album_with_artist', 5);
$albums = $this->faktory->buildMany('album_with_artist', 5);

$this->assertSame(5, count($albums));
foreach ($albums as $album) {
Expand All @@ -202,7 +202,7 @@ public function test_can_can_override_attribute_when_building_list()
$f->name = 'Bark at the moon';
$f->artist = 'Ozzy Osbourne';
});
$albums = $this->faktory->buildList('album_with_artist', 5, [
$albums = $this->faktory->buildMany('album_with_artist', 5, [
'artist' => 'Dio'
]);

Expand All @@ -220,7 +220,7 @@ public function test_can_can_override_attributes_independently_when_building_lis
$f->name = 'Bark at the moon';
$f->artist = 'Ozzy Osbourne';
});
$albums = $this->faktory->buildList('album_with_artist', 5, [
$albums = $this->faktory->buildMany('album_with_artist', 5, [
'artist' => [
'Dio',
'Black Sabbath',
Expand Down Expand Up @@ -259,7 +259,7 @@ public function test_can_can_override_attributes_independently_and_as_a_group_wh
$f->artist = 'Ozzy Osbourne';
$f->release_date = '1983-11-15';
});
$albums = $this->faktory->buildList('album_with_artist', 3, [
$albums = $this->faktory->buildMany('album_with_artist', 3, [
'artist' => [
'Dio',
'Black Sabbath',
Expand Down

0 comments on commit 09fdf51

Please sign in to comment.