Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/swoft-cloud/swoft-db
Browse files Browse the repository at this point in the history
  • Loading branch information
stelin committed Mar 14, 2018
2 parents 24d9bdd + ae65a15 commit e7daf23
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
14 changes: 3 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,14 @@ services:
- mysql

before_install:
- mysql -e 'CREATE DATABASE IF NOT EXISTS test;
CREATE TABLE IF NOT EXISTS `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(20) DEFAULT NULL,
`sex` int(1) NOT NULL DEFAULT '0',
`age` int(1) NOT NULL DEFAULT '0',
`description` varchar(240) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12082 DEFAULT CHARSET=utf8
'
- mysql -e 'CREATE DATABASE IF NOT EXISTS test;use test;CREATE TABLE IF NOT EXISTS `user` (`id` int(11) NOT NULL AUTO_INCREMENT,`name` varchar(20) DEFAULT NULL,`sex` int(1) NOT NULL DEFAULT '0',`age` int(1) NOT NULL DEFAULT '0',`description` varchar(240) DEFAULT NULL,PRIMARY KEY (`id`)) ENGINE=InnoDB AUTO_INCREMENT=12082 DEFAULT CHARSET=utf8;'

install:
- wget https://github.com/redis/hiredis/archive/v0.13.3.tar.gz -O hiredis.tar.gz && mkdir -p hiredis && tar -xf hiredis.tar.gz -C hiredis --strip-components=1 && cd hiredis && sudo make -j$(nproc) && sudo make install && sudo ldconfig && cd ..
- pecl install -f swoole-2.0.12
- pecl install -f swoole-2.1.1

before_script:
- phpenv config-rm xdebug.ini
- composer update

script: composer test
8 changes: 4 additions & 4 deletions test/Cases/PoolTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public function testDbEnv()
$this->assertEquals($pConfig->getProvider(), 'consul2');
$this->assertEquals($pConfig->getTimeout(), 2);
$this->assertEquals($pConfig->getUri(), [
'127.0.0.1:3306/test?user=root&password=123456&charset=utf8',
'127.0.0.1:3306/test?user=root&password=123456&charset=utf8',
'127.0.0.1:3306/test?user=root&password=&charset=utf8',
'127.0.0.1:3306/test?user=root&password=&charset=utf8',
]);
$this->assertEquals($pConfig->getBalancer(), 'random');
$this->assertEquals($pConfig->getMaxActive(), 2);
Expand Down Expand Up @@ -75,8 +75,8 @@ public function testDbSlaveEnv()
$this->assertEquals($pConfig->getProvider(), 'consul2');
$this->assertEquals($pConfig->getTimeout(), 3);
$this->assertEquals($pConfig->getUri(), [
'127.0.0.1:3306/test?user=root&password=123456&charset=utf8',
'127.0.0.1:3306/test?user=root&password=123456&charset=utf8',
'127.0.0.1:3306/test?user=root&password=&charset=utf8',
'127.0.0.1:3306/test?user=root&password=&charset=utf8',
]);
$this->assertEquals($pConfig->getBalancer(), 'random');
$this->assertEquals($pConfig->getMaxActive(), 2);
Expand Down

0 comments on commit e7daf23

Please sign in to comment.