File tree Expand file tree Collapse file tree 5 files changed +49
-4
lines changed Expand file tree Collapse file tree 5 files changed +49
-4
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,15 @@ Embedded relations now return an `Illuminate\Database\Eloquent\Collection` rathe
103
103
$books = $user->books()->sortBy('title');
104
104
```
105
105
106
+ Testing
107
+ -------
108
+
109
+ To run the test for this package, run:
110
+
111
+ ```
112
+ docker-compose up
113
+ ```
114
+
106
115
Configuration
107
116
-------------
108
117
Original file line number Diff line number Diff line change
1
+ version : ' 3'
2
+
3
+ services :
4
+
5
+ php :
6
+ build :
7
+ context : .
8
+ dockerfile : docker/Dockerfile
9
+ volumes :
10
+ - .:/code
11
+ working_dir : /code
12
+ command : php ./vendor/bin/phpunit
13
+ depends_on :
14
+ - mysql
15
+ - mongodb
16
+
17
+ mysql :
18
+ image : mysql
19
+ environment :
20
+ MYSQL_ROOT_PASSWORD :
21
+ MYSQL_DATABASE : unittest
22
+ MYSQL_ALLOW_EMPTY_PASSWORD : ' yes'
23
+ logging :
24
+ driver : none
25
+
26
+ mongodb :
27
+ image : mongo
28
+ logging :
29
+ driver : none
Original file line number Diff line number Diff line change
1
+ FROM php:7.1-cli
2
+
3
+ RUN apt-get update && \
4
+ apt-get install -y autoconf pkg-config libssl-dev && \
5
+ pecl install mongodb && docker-php-ext-enable mongodb && \
6
+ docker-php-ext-install -j$(nproc) pdo pdo_mysql
Original file line number Diff line number Diff line change @@ -98,12 +98,13 @@ public function testDriverName()
98
98
99
99
public function testAuth ()
100
100
{
101
+ $ host = Config::get ('database.connections.mongodb.host ' );
101
102
Config::set ('database.connections.mongodb.username ' , 'foo ' );
102
103
Config::set ('database.connections.mongodb.password ' , 'bar ' );
103
104
Config::set ('database.connections.mongodb.options.database ' , 'custom ' );
104
105
105
106
$ connection = DB ::connection ('mongodb ' );
106
- $ this ->assertEquals ('mongodb://127.0.0.1 /custom ' , (string ) $ connection ->getMongoClient ());
107
+ $ this ->assertEquals ('mongodb:// ' . $ host . ' /custom ' , (string ) $ connection ->getMongoClient ());
107
108
}
108
109
109
110
public function testCustomHostAndPort ()
Original file line number Diff line number Diff line change 7
7
'mongodb ' => [
8
8
'name ' => 'mongodb ' ,
9
9
'driver ' => 'mongodb ' ,
10
- 'host ' => '127.0.0.1 ' ,
10
+ 'host ' => 'mongodb ' ,
11
11
'database ' => 'unittest ' ,
12
12
],
13
13
14
14
'mysql ' => [
15
15
'driver ' => 'mysql ' ,
16
- 'host ' => '127.0.0.1 ' ,
16
+ 'host ' => 'mysql ' ,
17
17
'database ' => 'unittest ' ,
18
- 'username ' => 'travis ' ,
18
+ 'username ' => 'root ' ,
19
19
'password ' => '' ,
20
20
'charset ' => 'utf8 ' ,
21
21
'collation ' => 'utf8_unicode_ci ' ,
You can’t perform that action at this time.
0 commit comments