Unverified Commit 32974fda authored by Jens Segers's avatar Jens Segers Committed by GitHub

Merge pull request #1428 from RemiCollin/master

Laravel 5.6 support
parents 1bb259ae 1ed686d6
sudo: required
dist: trusty
language: php language: php
php: php:
- 7 - "7.2"
- 7.1 - "7.1"
matrix:
fast_finish: true
sudo: false
services: services:
- mongodb - docker
- mysql
install:
addons: # Update docker-engine using Ubuntu 'trusty' apt repo
apt: - >
sources: curl -sSL "https://get.docker.com/gpg" |
- mongodb-3.0-precise sudo -E apt-key add -
packages: - >
- mongodb-org-server echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" |
sudo tee -a /etc/apt/sources.list
before_script: - sudo apt-get update
- pecl install mongodb - >
- mysql -e 'create database unittest;' sudo apt-get -o Dpkg::Options::="--force-confdef" \
- travis_retry composer self-update -o Dpkg::Options::="--force-confold" --assume-yes install docker-engine --allow-unauthenticated
- travis_retry composer install --no-interaction - docker version
# Update docker-compose via pip
- sudo pip install docker-compose
- docker-compose version
- docker-compose up --build -d
- docker ps -a
script: script:
- mkdir -p build/logs - docker-compose up --exit-code-from php
- vendor/bin/phpunit --coverage-clover build/logs/clover.xml
after_success:
- sh -c 'php vendor/bin/coveralls -v'
...@@ -11,14 +11,14 @@ ...@@ -11,14 +11,14 @@
], ],
"license" : "MIT", "license" : "MIT",
"require": { "require": {
"illuminate/support": "^5.5", "illuminate/support": "^5.6",
"illuminate/container": "^5.5", "illuminate/container": "^5.6",
"illuminate/database": "^5.5", "illuminate/database": "^5.6",
"illuminate/events": "^5.5", "illuminate/events": "^5.6",
"mongodb/mongodb": "^1.0.0" "mongodb/mongodb": "^1.0.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^6.0", "phpunit/phpunit": "^6.0|^7.0",
"orchestra/testbench": "^3.1", "orchestra/testbench": "^3.1",
"mockery/mockery": "^1.0", "mockery/mockery": "^1.0",
"satooshi/php-coveralls": "^2.0", "satooshi/php-coveralls": "^2.0",
......
...@@ -3,6 +3,7 @@ version: '3' ...@@ -3,6 +3,7 @@ version: '3'
services: services:
php: php:
container_name: php
build: build:
context: . context: .
dockerfile: docker/Dockerfile dockerfile: docker/Dockerfile
...@@ -15,6 +16,7 @@ services: ...@@ -15,6 +16,7 @@ services:
- mongodb - mongodb
mysql: mysql:
container_name: mysql
image: mysql image: mysql
environment: environment:
MYSQL_ROOT_PASSWORD: MYSQL_ROOT_PASSWORD:
...@@ -24,6 +26,7 @@ services: ...@@ -24,6 +26,7 @@ services:
driver: none driver: none
mongodb: mongodb:
container_name: mongodb
image: mongo image: mongo
logging: logging:
driver: none driver: none
FROM php:7.1-cli FROM php:7.1-cli
RUN pecl install xdebug
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y autoconf pkg-config libssl-dev && \ apt-get install -y autoconf pkg-config libssl-dev git && \
pecl install mongodb && docker-php-ext-enable mongodb && \ pecl install mongodb git zlib1g-dev && docker-php-ext-enable mongodb && \
docker-php-ext-install -j$(nproc) pdo pdo_mysql docker-php-ext-install -j$(nproc) pdo pdo_mysql zip && docker-php-ext-enable xdebug
RUN curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/ \
&& ln -s /usr/local/bin/composer.phar /usr/local/bin/composer
ENV PATH="~/.composer/vendor/bin:./vendor/bin:${PATH}"
\ No newline at end of file
#!/usr/bin/env bash #!/usr/bin/env bash
sleep 3 && php ./vendor/bin/phpunit sleep 3 && composer install --prefer-source --no-interaction && php ./vendor/bin/phpunit
...@@ -169,9 +169,10 @@ trait HybridRelations ...@@ -169,9 +169,10 @@ trait HybridRelations
* @param string $name * @param string $name
* @param string $type * @param string $type
* @param string $id * @param string $id
* @param string $ownerKey
* @return \Illuminate\Database\Eloquent\Relations\MorphTo * @return \Illuminate\Database\Eloquent\Relations\MorphTo
*/ */
public function morphTo($name = null, $type = null, $id = null) public function morphTo($name = null, $type = null, $id = null, $ownerKey = null)
{ {
// If no name is provided, we will use the backtrace to get the function name // If no name is provided, we will use the backtrace to get the function name
// since that is most likely the name of the polymorphic interface. We can // since that is most likely the name of the polymorphic interface. We can
......
...@@ -101,7 +101,7 @@ abstract class Model extends BaseModel ...@@ -101,7 +101,7 @@ abstract class Model extends BaseModel
/** /**
* @inheritdoc * @inheritdoc
*/ */
protected function getDateFormat() public function getDateFormat()
{ {
return $this->dateFormat ?: 'Y-m-d H:i:s'; return $this->dateFormat ?: 'Y-m-d H:i:s';
} }
......
...@@ -117,7 +117,7 @@ class MongoQueue extends DatabaseQueue ...@@ -117,7 +117,7 @@ class MongoQueue extends DatabaseQueue
})->get(); })->get();
foreach ($reserved as $job) { foreach ($reserved as $job) {
$attempts = $job['attempts']; $attempts = $job['attempts'] + 1;
$this->releaseJob($job['_id'], $attempts); $this->releaseJob($job['_id'], $attempts);
} }
} }
......
...@@ -96,6 +96,18 @@ class Builder extends \Illuminate\Database\Schema\Builder ...@@ -96,6 +96,18 @@ class Builder extends \Illuminate\Database\Schema\Builder
} }
} }
/**
* @inheritdoc
*/
public function dropIfExists($collection)
{
if ($this->hasCollection($collection)) {
return $this->drop($collection);
}
return false;
}
/** /**
* @inheritdoc * @inheritdoc
*/ */
......
...@@ -65,7 +65,7 @@ class User extends Eloquent implements AuthenticatableContract, CanResetPassword ...@@ -65,7 +65,7 @@ class User extends Eloquent implements AuthenticatableContract, CanResetPassword
return $this->embedsOne('User'); return $this->embedsOne('User');
} }
protected function getDateFormat() public function getDateFormat()
{ {
return 'l jS \of F Y h:i:s A'; return 'l jS \of F Y h:i:s A';
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment