Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4408fc6

Browse files
committed
Configure travis for MysqlStore
1 parent 2a944df commit 4408fc6

File tree

5 files changed

+12
-13
lines changed

5 files changed

+12
-13
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ cache:
3636
services:
3737
- memcached
3838
- mongodb
39+
- mysql
3940
- redis-server
4041

4142
before_install:

phpunit.xml.dist

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
<env name="LDAP_PORT" value="3389" />
2020
<env name="REDIS_HOST" value="localhost" />
2121
<env name="MEMCACHED_HOST" value="localhost" />
22+
<env name="MYSQL_HOST" value="127.0.0.1" />
23+
<env name="MYSQL_USERNAME" value="root" />
24+
<env name="MYSQL_PASSWORD" value="" />
2225
</php>
2326

2427
<testsuites>

src/Symfony/Component/Lock/Store/MysqlStore.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class MysqlStore implements StoreInterface
2626
private $username;
2727
private $password;
2828
private $options;
29-
3029
private $waitTimeout;
3130

3231
/**

src/Symfony/Component/Lock/Tests/Store/MysqlStoreTest.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,17 @@ class MysqlStoreTest extends AbstractStoreTest
2727
*/
2828
public function getStore()
2929
{
30-
return new MysqlStore(getenv('MYSQL_DSN'), array(
31-
'db_username' => getenv('MYSQL_USER'),
30+
return new MysqlStore('mysql:host='.getenv('MYSQL_HOST'), array(
31+
'db_username' => getenv('MYSQL_USERNAME'),
3232
'db_password' => getenv('MYSQL_PASSWORD'),
33+
'wait_timeout' => 1,
3334
));
3435
}
3536

36-
/**
37-
* @medium
38-
*
39-
* @todo use phpunit/php-invoker to avoid infinite wait ?
40-
*/
4137
public function testConfigurableWaitTimeout()
4238
{
43-
$store = new MysqlStore(getenv('MYSQL_DSN'), array(
44-
'db_username' => getenv('MYSQL_USER'),
39+
$store = new MysqlStore('mysql:host='.getenv('MYSQL_HOST'), array(
40+
'db_username' => getenv('MYSQL_USERNAME'),
4541
'db_password' => getenv('MYSQL_PASSWORD'),
4642
'wait_timeout' => 1,
4743
));
@@ -50,7 +46,7 @@ public function testConfigurableWaitTimeout()
5046
$key1 = new Key($resource);
5147
$key2 = new Key($resource);
5248

53-
$store->waitAndSave($key1);
49+
$store->save($key1);
5450

5551
$startTime = microtime(true);
5652

src/Symfony/Component/Lock/phpunit.xml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<ini name="error_reporting" value="-1" />
1313
<env name="REDIS_HOST" value="localhost" />
1414
<env name="MEMCACHED_HOST" value="localhost" />
15-
<env name="MYSQL_DSN" value="mysql:host=localhost" />
16-
<env name="MYSQL_USER" value="root" />
15+
<env name="MYSQL_HOST" value="127.0.0.1" />
16+
<env name="MYSQL_USERNAME" value="root" />
1717
<env name="MYSQL_PASSWORD" value="" />
1818
</php>
1919

0 commit comments

Comments
 (0)