Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-php-library
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
mongo-php-library
Commits
41453429
Commit
41453429
authored
Dec 12, 2014
by
Hannes Magnusson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Missed committing the helper functions
parent
fc0cbcf9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
utils.inc
tests/utils.inc
+44
-0
No files found.
tests/utils.inc
0 → 100644
View file @
41453429
<?php
require_once
__DIR__
.
"/"
.
"../vendor/autoload.php"
;
function
createUser
(
$faker
)
{
return
array
(
"username"
=>
$faker
->
unique
()
->
userName
,
"password"
=>
$faker
->
sha256
,
"email"
=>
$faker
->
unique
()
->
safeEmail
,
"firstName"
=>
$faker
->
firstName
,
"lastName"
=>
$faker
->
lastName
,
"phoneNumber"
=>
$faker
->
phoneNumber
,
"altPhoneNumber"
=>
$faker
->
optional
(
0.1
)
->
phoneNumber
,
"company"
=>
$faker
->
company
,
"bio"
=>
$faker
->
paragraph
,
"createdAt"
=>
$faker
->
dateTimeBetween
(
"2008-01-01T00:00:00+0000"
,
"2014-08-01T00:00:00+0000"
)
->
getTimestamp
(),
"addresses"
=>
(
object
)
array
(
createAddress
(
$faker
),
createAddress
(
$faker
),
createAddress
(
$faker
),
),
);
}
function
createAddress
(
$faker
)
{
return
(
object
)
array
(
"streetAddress"
=>
$faker
->
streetAddress
,
"city"
=>
$faker
->
city
,
"state"
=>
$faker
->
state
,
"postalCode"
=>
$faker
->
postcode
,
"loc"
=>
createGeoJsonPoint
(
$faker
),
);
}
function
createGeoJsonPoint
(
$faker
)
{
return
(
object
)
array
(
"type"
=>
"Point"
,
"coordinates"
=>
(
object
)
array
(
$faker
->
longitude
,
$faker
->
latitude
),
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment