Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a9bbd20

Browse files
Merge branch 'codeception-2.1' into codeception-2.2
2 parents ff46c1d + 7468eb5 commit a9bbd20

File tree

7 files changed

+88
-0
lines changed

7 files changed

+88
-0
lines changed

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99
/tags
1010
.env
1111
.idea
12+
.vagrant
1213
composer.lock

‎.gitmodules‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "homestead"]
2+
path = homestead
3+
url = https://github.com/laravel/homestead.git

‎Homestead.yaml‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
ip: "192.168.10.10"
3+
memory: 2048
4+
cpus: 1
5+
name: "Codeception Laravel 5 Sample"
6+
provider: virtualbox
7+
8+
folders:
9+
- map: "."
10+
to: "/home/vagrant/code"
11+
12+
sites:
13+
- map: homestead.app
14+
to: "/home/vagrant/code/public"
15+
16+
databases:
17+
- homestead
18+
19+
# blackfire:
20+
# - id: foo
21+
# token: bar
22+
# client-id: foo
23+
# client-token: bar
24+
25+
# ports:
26+
# - send: 50000
27+
# to: 5000
28+
# - send: 7777
29+
# to: 777
30+
# protocol: udp

‎Vagrantfile‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
require 'json'
2+
require 'yaml'
3+
4+
VAGRANTFILE_API_VERSION ||= "2"
5+
confDir = $confDir ||= File.expand_path("./homestead", File.dirname(__FILE__))
6+
7+
homesteadYamlPath = "Homestead.yaml"
8+
homesteadJsonPath = "Homestead.json"
9+
afterScriptPath = "after.sh"
10+
aliasesPath = "aliases"
11+
12+
require File.expand_path(confDir + '/scripts/homestead.rb')
13+
14+
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
15+
if File.exists? aliasesPath then
16+
config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases"
17+
end
18+
19+
if File.exists? homesteadYamlPath then
20+
Homestead.configure(config, YAML::load(File.read(homesteadYamlPath)))
21+
elsif File.exists? homesteadJsonPath then
22+
Homestead.configure(config, JSON.parse(File.read(homesteadJsonPath)))
23+
end
24+
25+
if File.exists? afterScriptPath then
26+
config.vm.provision "shell", path: afterScriptPath
27+
end
28+
end

‎after.sh‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
cd code
6+
7+
sudo -u vagrant -H bash -c "cp .env.testing .env; \
8+
composer install -n --prefer-dist; \
9+
if [ ! -f ~/.key_generated ]; then php artisan key:generate; touch ~/.key_generated; fi; \
10+
touch storage/database.sqlite; \
11+
touch storage/testing.sqlite; \
12+
php artisan migrate; \
13+
php artisan migrate --database=sqlite_testing;"

‎homestead‎

Submodule homestead added at 69e1e46

‎readme.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
### Setup
66

7+
You can setup this sample manually or use [Vagrant](https://www.vagrantup.com/) to automatically set up a development environment for you.
8+
9+
#### Manual
710
- Clone repo
811
- Create your .env file from the example file: `cp .env.testing .env`
912
- Install composer dependencies: `composer install`
@@ -16,6 +19,15 @@
1619
- Server: run `php -S localhost:8000 -t public`
1720
- Browse to localhost:8000/posts
1821

22+
#### Vagrant
23+
- Clone repo
24+
- Cd into the cloned directory
25+
- Install git submodules: `git submodule update --init --recursive`
26+
- you can also add the `--recursive` flag to the `git clone` command to skip this step
27+
- Run `vagrant up`
28+
29+
To SSH into the machine to run your tests, run `vagrant ssh`. You can access the app on the guest VM under http://192.168.10.10/.
30+
1931
### To test
2032

2133
Run Codeception, installed via Composer

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /