Skip to content

Commit 827442a

Browse files
committed
Merged pull request #898
2 parents 374300f + 86f0b8c commit 827442a

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

.travis.scripts/atlas-uris.txt.enc

1.36 KB
Binary file not shown.

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ env:
1616

1717
matrix:
1818
include:
19+
- php: 7.2
20+
env:
21+
- TESTS=tests/atlas.phpt
22+
- TEST_PHP_ARGS="-q -s output.txt -x --show-diff"
1923
- php: 5.5
2024
- php: 5.6
2125
- php: 7.0
@@ -54,6 +58,7 @@ matrix:
5458
- SERVER_VERSION=3.6.5
5559

5660
before_install:
61+
- openssl aes-256-cbc -K $encrypted_b354efda2943_key -iv $encrypted_b354efda2943_iv -in .travis.scripts/atlas-uris.txt.enc -out .travis.scripts/atlas-uris.txt -d
5762
- pip install "mongo-orchestration>=0.6.7,<1.0" --user `whoami`
5863
- .travis.scripts/before_install.sh
5964
- wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1404-${SERVER_VERSION}.tgz

tests/atlas.phpt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
--TEST--
2+
Atlas Connectivity Tests
3+
--SKIPIF--
4+
<?php
5+
if (!file_exists('.travis.scripts/atlas-uris.txt')) { echo "skip Atlas URIs not found\n"; }
6+
if ($_ENV['TESTS'] !== 'tests/atlas.phpt') { echo "skip Atlas tests not wanted\n"; }
7+
?>
8+
--FILE--
9+
<?php
10+
$urls = explode("\n", file_get_contents('.travis.scripts/atlas-uris.txt'));
11+
12+
$isMasterCmd = new \MongoDB\Driver\Command(['isMaster' => 1]);
13+
$query = new \MongoDB\Driver\Query([]);
14+
15+
foreach ($urls as $url) {
16+
$url = trim($url);
17+
if ($url == '') {
18+
continue;
19+
}
20+
21+
try {
22+
$m = new \MongoDB\Driver\Manager($url);
23+
$m->executeCommand('admin', $isMasterCmd);
24+
iterator_to_array($m->executeQuery('test.test', $query));
25+
echo "PASS\n";
26+
} catch(Exception $e) {
27+
echo "FAIL: ", $e->getMessage(), "\n";
28+
}
29+
}
30+
?>
31+
===DONE===
32+
<?php exit(0); ?>
33+
--EXPECTF--
34+
PASS
35+
PASS
36+
PASS
37+
PASS
38+
PASS
39+
FAIL: %s
40+
===DONE===

0 commit comments

Comments
 (0)