Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
239 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
if (php_sapi_name() !== "cli") { | ||
die('CLI only'); | ||
} | ||
|
||
if (!class_exists('Memcache')) { | ||
fwrite(STDOUT, 'PHP memcache module not installed'); | ||
exit(1); | ||
} | ||
|
||
$memcached = new Memcache; | ||
if (!$memcached->connect('127.0.0.1', 11211)) { | ||
fwrite(STDOUT, 'Failed to connect to memcache server'); | ||
exit(2); | ||
} | ||
|
||
$memcached->close(); | ||
fwrite(STDOUT, 'Successfully connected to memcache server'); | ||
exit(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
|
||
global $CONFIG; | ||
|
||
if (!isset($CONFIG)) { | ||
$CONFIG = new \stdClass; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
global $CONFIG; | ||
|
||
if (!isset($CONFIG)) { | ||
$CONFIG = new \stdClass; | ||
} | ||
|
||
// Memcached configuration for Travis | ||
$CONFIG->memcache = true; | ||
$CONFIG->memcache_servers = [ | ||
['127.0.0.1', 11211], | ||
]; | ||
$CONFIG->memcache_namespace_prefix = 'elgg_'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
global $CONFIG; | ||
|
||
if (!isset($CONFIG)) { | ||
$CONFIG = new \stdClass; | ||
} | ||
|
||
$CONFIG->debug = 'NOTICE'; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
global $CONFIG; | ||
|
||
if (!isset($CONFIG)) { | ||
$CONFIG = new \stdClass; | ||
} | ||
|
||
$CONFIG->debug = 'NOTICE'; | ||
|
||
// Memcached configuration for Travis | ||
$CONFIG->memcache = true; | ||
$CONFIG->memcache_servers = [ | ||
['127.0.0.1', 11211], | ||
]; | ||
$CONFIG->memcache_namespace_prefix = 'elgg_'; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
extension = "memcache.so" | ||
extension = "memcached.so" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<phpunit bootstrap="../../vendor/autoload.php"> | ||
<testsuites> | ||
<testsuite name="core_memcached"> | ||
<directory>../../engine/tests/phpunit/</directory> | ||
<directory>../../engine/classes/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<blacklist> | ||
<directory suffix=".php">/engine/tests</directory> | ||
<directory suffix=".php">/engine/lib/upgrades</directory> | ||
<file>/engine/settings.example.php</file> | ||
<directory suffix=".php">/vendor</directory> | ||
<directory suffix=".php">/vendors</directory> | ||
<directory suffix=".php">/docs</directory> | ||
</blacklist> | ||
</filter> | ||
<listeners> | ||
<listener class="\Elgg\TestListener"> | ||
<arguments> | ||
<string>./.scripts/travis/elgg-config/</string> | ||
</arguments> | ||
</listener> | ||
</listeners> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace Elgg; | ||
|
||
use PHPUnit_Framework_BaseTestListener; | ||
use PHPUnit_Framework_TestSuite; | ||
|
||
class TestListener extends PHPUnit_Framework_BaseTestListener { | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $config_dir; | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param string $config_dir Directory containing suite-speicific config files | ||
*/ | ||
public function __construct($config_dir) { | ||
$this->config_dir = $config_dir; | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function startTestSuite(PHPUnit_Framework_TestSuite $suite) { | ||
|
||
// reset config before each suite | ||
global $CONFIG; | ||
unset($CONFIG); | ||
|
||
$name = $suite->getName(); | ||
$dir = rtrim($this->config_dir, '/'); | ||
|
||
if (file_exists("$dir/$name.php")) { | ||
require_once "$dir/$name.php"; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
/** | ||
* Configuration specific to a "core" test suite | ||
*/ | ||
|
||
global $CONFIG; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.