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
php:
- 7
- 7.1
matrix:
fast_finish: true
sudo: false
- "7.2"
- "7.1"
services:
- mongodb
- mysql
addons:
apt:
sources:
- mongodb-3.0-precise
packages:
- mongodb-org-server
before_script:
- pecl install mongodb
- mysql -e 'create database unittest;'
- travis_retry composer self-update
- travis_retry composer install --no-interaction
- docker
install:
# Update docker-engine using Ubuntu 'trusty' apt repo
- >
curl -sSL "https://get.docker.com/gpg" |
sudo -E apt-key add -
- >
echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" |
sudo tee -a /etc/apt/sources.list
- sudo apt-get update
- >
sudo apt-get -o Dpkg::Options::="--force-confdef" \
-o Dpkg::Options::="--force-confold" --assume-yes install docker-engine --allow-unauthenticated
- docker version
# Update docker-compose via pip
- sudo pip install docker-compose
- docker-compose version
- docker-compose up --build -d
- docker ps -a
script:
- mkdir -p build/logs
- vendor/bin/phpunit --coverage-clover build/logs/clover.xml
after_success:
- sh -c 'php vendor/bin/coveralls -v'
- docker-compose up --exit-code-from php
......@@ -11,14 +11,14 @@
],
"license" : "MIT",
"require": {
"illuminate/support": "^5.5",
"illuminate/container": "^5.5",
"illuminate/database": "^5.5",
"illuminate/events": "^5.5",
"illuminate/support": "^5.6",
"illuminate/container": "^5.6",
"illuminate/database": "^5.6",
"illuminate/events": "^5.6",
"mongodb/mongodb": "^1.0.0"
},
"require-dev": {
"phpunit/phpunit": "^6.0",
"phpunit/phpunit": "^6.0|^7.0",
"orchestra/testbench": "^3.1",
"mockery/mockery": "^1.0",
"satooshi/php-coveralls": "^2.0",
......
......@@ -3,6 +3,7 @@ version: '3'
services:
php:
container_name: php
build:
context: .
dockerfile: docker/Dockerfile
......@@ -15,6 +16,7 @@ services:
- mongodb
mysql:
container_name: mysql
image: mysql
environment:
MYSQL_ROOT_PASSWORD:
......@@ -24,6 +26,7 @@ services:
driver: none
mongodb:
container_name: mongodb
image: mongo
logging:
driver: none
FROM php:7.1-cli
RUN pecl install xdebug
RUN apt-get update && \
apt-get install -y autoconf pkg-config libssl-dev && \
pecl install mongodb && docker-php-ext-enable mongodb && \
docker-php-ext-install -j$(nproc) pdo pdo_mysql
apt-get install -y autoconf pkg-config libssl-dev git && \
pecl install mongodb git zlib1g-dev && docker-php-ext-enable mongodb && \
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
sleep 3 && php ./vendor/bin/phpunit
sleep 3 && composer install --prefer-source --no-interaction && php ./vendor/bin/phpunit
......@@ -169,9 +169,10 @@ trait HybridRelations
* @param string $name
* @param string $type
* @param string $id
* @param string $ownerKey
* @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
// since that is most likely the name of the polymorphic interface. We can
......
......@@ -101,7 +101,7 @@ abstract class Model extends BaseModel
/**
* @inheritdoc
*/
protected function getDateFormat()
public function getDateFormat()
{
return $this->dateFormat ?: 'Y-m-d H:i:s';
}
......
......@@ -117,7 +117,7 @@ class MongoQueue extends DatabaseQueue
})->get();
foreach ($reserved as $job) {
$attempts = $job['attempts'];
$attempts = $job['attempts'] + 1;
$this->releaseJob($job['_id'], $attempts);
}
}
......
......@@ -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
*/
......
......@@ -65,7 +65,7 @@ class User extends Eloquent implements AuthenticatableContract, CanResetPassword
return $this->embedsOne('User');
}
protected function getDateFormat()
public function getDateFormat()
{
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