Skip to content

Commit

Permalink
Fixed documentation url path for apib to not be relative to root, fix…
Browse files Browse the repository at this point in the history
…ed unique user value checker as a typo was causing it to not bind correctly.
  • Loading branch information
zakhenry committed Aug 31, 2015
1 parent 51418fd commit 800dedc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions api/app/Http/Controllers/ApiaryController.php
Expand Up @@ -13,13 +13,13 @@ class ApiaryController extends Controller
public function index()
{
return view('documentation.layouts.master', [
'apibUrl' => '/documentation.apib',
'apibUrl' => 'documentation.apib',
]);
}

public function getApiaryDocumentation(Request $request)
public function getApiaryDocumentation()
{
$apib = $this->getDocumentationApib($request->root());
$apib = $this->getDocumentationApib(env('API_HOST'));

$headers = [
'Content-Type' => 'text/plain',
Expand Down
12 changes: 6 additions & 6 deletions api/tests/Traits/HelpersTrait.php
Expand Up @@ -11,7 +11,7 @@ trait HelpersTrait
*
* @var array
*/
protected $uniques;
protected $uniqueUserValues;

/**
* @return Faker
Expand All @@ -20,14 +20,14 @@ protected function getFakerWithUniqueUserData()
{
// Prepare an array with user data already used
$users = User::all();
if (!$this->uniques) {
if (!$this->uniqueUserValues) {
$uniques = ['username' => [], 'email' => []];
foreach ($users as $user) {
array_push($uniques['username'], [$user->username => null]);
array_push($uniques['email'], [$user->email => null]);
}

$this->uniques = $uniques;
$this->uniqueUserValues = $uniques;
}

// As the array of already used faker data is protected in Faker and
Expand All @@ -41,11 +41,11 @@ protected function getFakerWithUniqueUserData()
$unique = $faker->unique();

$binder = function ($value) {
$this->unqiue = $value;
$this->uniqueUserValues = $value;
};

$unqiueBinder = $binder->bindTo($unique, $unique);
$unqiueBinder($this->uniques);
$uniqueBinder = $binder->bindTo($unique, $unique);
$uniqueBinder($this->uniqueUserValues);

return $faker;
}
Expand Down

0 comments on commit 800dedc

Please sign in to comment.