32
1
mirror of https://github.com/joomla-extensions/weblinks.git synced 2024-12-27 02:12:50 +00:00

Merge pull request #190 from yvesh/unit_tests

Adding possibilty to run unit tests for com_weblinks with robo and codeception
This commit is contained in:
javier gomez 2016-02-29 12:17:44 +01:00
commit 2f8341a00b
4 changed files with 269 additions and 112 deletions

View File

@ -491,4 +491,22 @@ class RoboFile extends \Robo\Tasks
$this->taskBuild($params)->run();
}
/**
* Executes all unit tests
*/
public function runUnit()
{
$this->createTestingSite();
$this->getComposer();
$this->taskComposerInstall()->run();
// Make sure to run the build command to generate AcceptanceTester
$this->_exec($this->isWindows() ? 'vendor\bin\codecept.bat build' : 'php vendor/bin/codecept build');
$this->taskCodecept()
->suite('unit')
->run()
->stopOnFail();
}
}

226
composer.lock generated
View File

@ -4,22 +4,22 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "0b0461b0995176734e97058d396d8694",
"content-hash": "358f3c4abf049960c9d943efe5f5f087",
"hash": "1e3e0add6228d19ee5580d19ed426383",
"content-hash": "d1da90234fe92608e1ef6ca698ece882",
"packages": [],
"packages-dev": [
{
"name": "codeception/codeception",
"version": "2.1.5",
"version": "2.1.6",
"source": {
"type": "git",
"url": "https://github.com/Codeception/Codeception.git",
"reference": "4ee562f421fd404139dd7b73ae46d075396a4baf"
"reference": "b199941f5e59d1e7fd32d78296c8ab98db873d89"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Codeception/Codeception/zipball/4ee562f421fd404139dd7b73ae46d075396a4baf",
"reference": "4ee562f421fd404139dd7b73ae46d075396a4baf",
"url": "https://api.github.com/repos/Codeception/Codeception/zipball/b199941f5e59d1e7fd32d78296c8ab98db873d89",
"reference": "b199941f5e59d1e7fd32d78296c8ab98db873d89",
"shasum": ""
},
"require": {
@ -86,7 +86,7 @@
"functional testing",
"unit testing"
],
"time": "2015-12-20 12:11:42"
"time": "2016-02-09 22:27:48"
},
{
"name": "codegyre/robo",
@ -495,16 +495,16 @@
},
{
"name": "guzzlehttp/psr7",
"version": "1.2.2",
"version": "1.2.3",
"source": {
"type": "git",
"url": "https://github.com/guzzle/psr7.git",
"reference": "f5d04bdd2881ac89abde1fb78cc234bce24327bb"
"reference": "2e89629ff057ebb49492ba08e6995d3a6a80021b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/f5d04bdd2881ac89abde1fb78cc234bce24327bb",
"reference": "f5d04bdd2881ac89abde1fb78cc234bce24327bb",
"url": "https://api.github.com/repos/guzzle/psr7/zipball/2e89629ff057ebb49492ba08e6995d3a6a80021b",
"reference": "2e89629ff057ebb49492ba08e6995d3a6a80021b",
"shasum": ""
},
"require": {
@ -549,7 +549,7 @@
"stream",
"uri"
],
"time": "2016-01-23 01:23:02"
"time": "2016-02-18 21:54:00"
},
{
"name": "halleck45/phpmetrics",
@ -799,16 +799,16 @@
},
{
"name": "joomla-projects/selenium-server-standalone",
"version": "v2.51.0",
"version": "v2.52.0",
"source": {
"type": "git",
"url": "https://github.com/joomla-projects/selenium-server-standalone.git",
"reference": "30bd42c4facebcf04e826065a1ea5f17a1078332"
"reference": "17b4bb3fd087ded32fe2d9342b8573a75f56460c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/joomla-projects/selenium-server-standalone/zipball/30bd42c4facebcf04e826065a1ea5f17a1078332",
"reference": "30bd42c4facebcf04e826065a1ea5f17a1078332",
"url": "https://api.github.com/repos/joomla-projects/selenium-server-standalone/zipball/17b4bb3fd087ded32fe2d9342b8573a75f56460c",
"reference": "17b4bb3fd087ded32fe2d9342b8573a75f56460c",
"shasum": ""
},
"bin": [
@ -831,7 +831,7 @@
"selenium",
"testing"
],
"time": "2016-02-08 10:51:31"
"time": "2016-02-16 11:07:51"
},
{
"name": "joomla/compat",
@ -1212,26 +1212,26 @@
},
{
"name": "pdepend/pdepend",
"version": "2.2.2",
"version": "2.2.3",
"source": {
"type": "git",
"url": "https://github.com/pdepend/pdepend.git",
"reference": "d3ae0d084d526cdc6c3f1b858fb7148de77b41c5"
"reference": "9d816dfa565b9c47685057761acaf432c9e8066a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/pdepend/pdepend/zipball/d3ae0d084d526cdc6c3f1b858fb7148de77b41c5",
"reference": "d3ae0d084d526cdc6c3f1b858fb7148de77b41c5",
"url": "https://api.github.com/repos/pdepend/pdepend/zipball/9d816dfa565b9c47685057761acaf432c9e8066a",
"reference": "9d816dfa565b9c47685057761acaf432c9e8066a",
"shasum": ""
},
"require": {
"php": ">=5.3.7",
"symfony/config": "^2.3.0",
"symfony/dependency-injection": "^2.3.0",
"symfony/filesystem": "^2.3.0"
"symfony/config": "^2.3.0|^3",
"symfony/dependency-injection": "^2.3.0|^3",
"symfony/filesystem": "^2.3.0|^3"
},
"require-dev": {
"phpunit/phpunit": "^4.0.0,<4.8",
"phpunit/phpunit": "^4.4.0,<4.8",
"squizlabs/php_codesniffer": "^2.0.0"
},
"bin": [
@ -1239,8 +1239,8 @@
],
"type": "library",
"autoload": {
"psr-0": {
"PDepend\\": "src/main/php/"
"psr-4": {
"PDepend\\": "src/main/php/PDepend"
}
},
"notification-url": "https://packagist.org/downloads/",
@ -1248,7 +1248,7 @@
"BSD-3-Clause"
],
"description": "Official version of pdepend to be handled with Composer",
"time": "2015-10-16 08:49:58"
"time": "2016-02-23 08:20:26"
},
{
"name": "phpdocumentor/reflection-docblock",
@ -1419,22 +1419,24 @@
},
{
"name": "phpspec/prophecy",
"version": "v1.5.0",
"version": "v1.6.0",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy.git",
"reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7"
"reference": "3c91bdf81797d725b14cb62906f9a4ce44235972"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/4745ded9307786b730d7a60df5cb5a6c43cf95f7",
"reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7",
"url": "https://api.github.com/repos/phpspec/prophecy/zipball/3c91bdf81797d725b14cb62906f9a4ce44235972",
"reference": "3c91bdf81797d725b14cb62906f9a4ce44235972",
"shasum": ""
},
"require": {
"doctrine/instantiator": "^1.0.2",
"php": "^5.3|^7.0",
"phpdocumentor/reflection-docblock": "~2.0",
"sebastian/comparator": "~1.1"
"sebastian/comparator": "~1.1",
"sebastian/recursion-context": "~1.0"
},
"require-dev": {
"phpspec/phpspec": "~2.0"
@ -1442,7 +1444,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4.x-dev"
"dev-master": "1.5.x-dev"
}
},
"autoload": {
@ -1475,7 +1477,7 @@
"spy",
"stub"
],
"time": "2015-08-13 10:07:40"
"time": "2016-02-15 07:46:21"
},
{
"name": "phpunit/php-code-coverage",
@ -1719,16 +1721,16 @@
},
{
"name": "phpunit/phpunit",
"version": "4.8.22",
"version": "4.8.23",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "dfb11aa5236376b4fc63853cf746af39fe780e72"
"reference": "6e351261f9cd33daf205a131a1ba61c6d33bd483"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/dfb11aa5236376b4fc63853cf746af39fe780e72",
"reference": "dfb11aa5236376b4fc63853cf746af39fe780e72",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6e351261f9cd33daf205a131a1ba61c6d33bd483",
"reference": "6e351261f9cd33daf205a131a1ba61c6d33bd483",
"shasum": ""
},
"require": {
@ -1787,7 +1789,7 @@
"testing",
"xunit"
],
"time": "2016-02-02 09:01:21"
"time": "2016-02-11 14:56:33"
},
{
"name": "phpunit/phpunit-mock-objects",
@ -2012,16 +2014,16 @@
},
{
"name": "sebastian/environment",
"version": "1.3.3",
"version": "1.3.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
"reference": "6e7133793a8e5a5714a551a8324337374be209df"
"reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6e7133793a8e5a5714a551a8324337374be209df",
"reference": "6e7133793a8e5a5714a551a8324337374be209df",
"url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf",
"reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf",
"shasum": ""
},
"require": {
@ -2058,7 +2060,7 @@
"environment",
"hhvm"
],
"time": "2015-12-02 08:37:27"
"time": "2016-02-26 18:40:46"
},
{
"name": "sebastian/exporter",
@ -2128,20 +2130,20 @@
},
{
"name": "sebastian/finder-facade",
"version": "1.2.0",
"version": "1.2.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/finder-facade.git",
"reference": "a520dcc3dd39160eea480daa3426f4fd419a327b"
"reference": "2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/finder-facade/zipball/a520dcc3dd39160eea480daa3426f4fd419a327b",
"reference": "a520dcc3dd39160eea480daa3426f4fd419a327b",
"url": "https://api.github.com/repos/sebastianbergmann/finder-facade/zipball/2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9",
"reference": "2a6f7f57efc0aa2d23297d9fd9e2a03111a8c0b9",
"shasum": ""
},
"require": {
"symfony/finder": "~2.3",
"symfony/finder": "~2.3|~3.0",
"theseer/fdomdocument": "~1.3"
},
"type": "library",
@ -2163,20 +2165,20 @@
],
"description": "FinderFacade is a convenience wrapper for Symfony's Finder component.",
"homepage": "https://github.com/sebastianbergmann/finder-facade",
"time": "2015-06-04 08:11:58"
"time": "2016-02-17 07:02:23"
},
{
"name": "sebastian/git",
"version": "2.0.1",
"version": "2.1.1",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/git.git",
"reference": "2d5c139d0eedcb9e67e0e9ca08023be6e9b7b47b"
"reference": "38638de3e94830a5cd7a5956135589b967609cd5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/git/zipball/2d5c139d0eedcb9e67e0e9ca08023be6e9b7b47b",
"reference": "2d5c139d0eedcb9e67e0e9ca08023be6e9b7b47b",
"url": "https://api.github.com/repos/sebastianbergmann/git/zipball/38638de3e94830a5cd7a5956135589b967609cd5",
"reference": "38638de3e94830a5cd7a5956135589b967609cd5",
"shasum": ""
},
"require": {
@ -2185,7 +2187,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
"dev-master": "2.1-dev"
}
},
"autoload": {
@ -2208,7 +2210,7 @@
"keywords": [
"git"
],
"time": "2015-04-06 16:23:43"
"time": "2016-02-21 15:02:23"
},
{
"name": "sebastian/global-state",
@ -2477,7 +2479,7 @@
},
{
"name": "symfony/browser-kit",
"version": "v3.0.2",
"version": "v3.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/browser-kit.git",
@ -2534,22 +2536,25 @@
},
{
"name": "symfony/config",
"version": "v2.8.2",
"version": "v2.8.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/config.git",
"reference": "41ee6c70758f40fa1dbf90d019ae0a66c4a09e74"
"reference": "0f8f94e6a32b5c480024eed5fa5cbd2790d0ad19"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/config/zipball/41ee6c70758f40fa1dbf90d019ae0a66c4a09e74",
"reference": "41ee6c70758f40fa1dbf90d019ae0a66c4a09e74",
"url": "https://api.github.com/repos/symfony/config/zipball/0f8f94e6a32b5c480024eed5fa5cbd2790d0ad19",
"reference": "0f8f94e6a32b5c480024eed5fa5cbd2790d0ad19",
"shasum": ""
},
"require": {
"php": ">=5.3.9",
"symfony/filesystem": "~2.3|~3.0.0"
},
"suggest": {
"symfony/yaml": "To use the yaml reference dumper"
},
"type": "library",
"extra": {
"branch-alias": {
@ -2580,20 +2585,20 @@
],
"description": "Symfony Config Component",
"homepage": "https://symfony.com",
"time": "2016-01-03 15:33:41"
"time": "2016-02-22 16:12:45"
},
{
"name": "symfony/console",
"version": "v2.8.2",
"version": "v2.8.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "d0239fb42f98dd02e7d342f793c5d2cdee0c478d"
"reference": "56cc5caf051189720b8de974e4746090aaa10d44"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/d0239fb42f98dd02e7d342f793c5d2cdee0c478d",
"reference": "d0239fb42f98dd02e7d342f793c5d2cdee0c478d",
"url": "https://api.github.com/repos/symfony/console/zipball/56cc5caf051189720b8de974e4746090aaa10d44",
"reference": "56cc5caf051189720b8de974e4746090aaa10d44",
"shasum": ""
},
"require": {
@ -2640,11 +2645,11 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"time": "2016-01-14 08:33:16"
"time": "2016-02-28 16:20:50"
},
{
"name": "symfony/css-selector",
"version": "v3.0.2",
"version": "v3.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
@ -2697,28 +2702,25 @@
},
{
"name": "symfony/dependency-injection",
"version": "v2.8.2",
"version": "v3.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/dependency-injection.git",
"reference": "ba94a914e244e0d05f0aaef460d5558d5541d2b1"
"reference": "821800ae6753b88dab55a7280811d8734b8112bf"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/ba94a914e244e0d05f0aaef460d5558d5541d2b1",
"reference": "ba94a914e244e0d05f0aaef460d5558d5541d2b1",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/821800ae6753b88dab55a7280811d8734b8112bf",
"reference": "821800ae6753b88dab55a7280811d8734b8112bf",
"shasum": ""
},
"require": {
"php": ">=5.3.9"
},
"conflict": {
"symfony/expression-language": "<2.6"
"php": ">=5.5.9"
},
"require-dev": {
"symfony/config": "~2.2|~3.0.0",
"symfony/expression-language": "~2.6|~3.0.0",
"symfony/yaml": "~2.1|~3.0.0"
"symfony/config": "~2.8|~3.0",
"symfony/expression-language": "~2.8|~3.0",
"symfony/yaml": "~2.8|~3.0"
},
"suggest": {
"symfony/config": "",
@ -2728,7 +2730,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.8-dev"
"dev-master": "3.0-dev"
}
},
"autoload": {
@ -2755,20 +2757,20 @@
],
"description": "Symfony DependencyInjection Component",
"homepage": "https://symfony.com",
"time": "2016-01-12 17:46:01"
"time": "2016-02-28 16:50:08"
},
{
"name": "symfony/dom-crawler",
"version": "v3.0.2",
"version": "v3.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/dom-crawler.git",
"reference": "b693a9650aa004576b593ff2e91ae749dc90123d"
"reference": "981c8edb4538f88ba976ed44bdcaa683fce3d6c6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/b693a9650aa004576b593ff2e91ae749dc90123d",
"reference": "b693a9650aa004576b593ff2e91ae749dc90123d",
"url": "https://api.github.com/repos/symfony/dom-crawler/zipball/981c8edb4538f88ba976ed44bdcaa683fce3d6c6",
"reference": "981c8edb4538f88ba976ed44bdcaa683fce3d6c6",
"shasum": ""
},
"require": {
@ -2811,20 +2813,20 @@
],
"description": "Symfony DomCrawler Component",
"homepage": "https://symfony.com",
"time": "2016-01-25 09:56:57"
"time": "2016-02-28 16:24:34"
},
{
"name": "symfony/event-dispatcher",
"version": "v2.8.2",
"version": "v2.8.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "ee278f7c851533e58ca307f66305ccb9188aceda"
"reference": "78c468665c9568c3faaa9c416a7134308f2d85c3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ee278f7c851533e58ca307f66305ccb9188aceda",
"reference": "ee278f7c851533e58ca307f66305ccb9188aceda",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/78c468665c9568c3faaa9c416a7134308f2d85c3",
"reference": "78c468665c9568c3faaa9c416a7134308f2d85c3",
"shasum": ""
},
"require": {
@ -2871,20 +2873,20 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"time": "2016-01-13 10:28:07"
"time": "2016-01-27 05:14:19"
},
{
"name": "symfony/filesystem",
"version": "v2.8.2",
"version": "v2.8.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
"reference": "637b64d0ee10f44ae98dbad651b1ecdf35a11e8c"
"reference": "65cb36b6539b1d446527d60457248f30d045464d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/637b64d0ee10f44ae98dbad651b1ecdf35a11e8c",
"reference": "637b64d0ee10f44ae98dbad651b1ecdf35a11e8c",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/65cb36b6539b1d446527d60457248f30d045464d",
"reference": "65cb36b6539b1d446527d60457248f30d045464d",
"shasum": ""
},
"require": {
@ -2920,20 +2922,20 @@
],
"description": "Symfony Filesystem Component",
"homepage": "https://symfony.com",
"time": "2016-01-13 10:28:07"
"time": "2016-02-22 15:02:30"
},
{
"name": "symfony/finder",
"version": "v2.8.2",
"version": "v2.8.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
"reference": "c90fabdd97e431ee19b6383999cf35334dff27da"
"reference": "877bb4b16ea573cc8c024e9590888fcf7eb7e0f7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/c90fabdd97e431ee19b6383999cf35334dff27da",
"reference": "c90fabdd97e431ee19b6383999cf35334dff27da",
"url": "https://api.github.com/repos/symfony/finder/zipball/877bb4b16ea573cc8c024e9590888fcf7eb7e0f7",
"reference": "877bb4b16ea573cc8c024e9590888fcf7eb7e0f7",
"shasum": ""
},
"require": {
@ -2969,7 +2971,7 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
"time": "2016-01-14 08:26:52"
"time": "2016-02-22 16:12:45"
},
{
"name": "symfony/polyfill-mbstring",
@ -3032,16 +3034,16 @@
},
{
"name": "symfony/process",
"version": "v2.8.2",
"version": "v2.8.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "6f1979c3b0f4c22c77a8a8971afaa7dd07f082ac"
"reference": "7dedd5b60550f33dca16dd7e94ef8aca8b67bbfe"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/6f1979c3b0f4c22c77a8a8971afaa7dd07f082ac",
"reference": "6f1979c3b0f4c22c77a8a8971afaa7dd07f082ac",
"url": "https://api.github.com/repos/symfony/process/zipball/7dedd5b60550f33dca16dd7e94ef8aca8b67bbfe",
"reference": "7dedd5b60550f33dca16dd7e94ef8aca8b67bbfe",
"shasum": ""
},
"require": {
@ -3077,20 +3079,20 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
"time": "2016-01-06 09:59:23"
"time": "2016-02-02 13:33:15"
},
{
"name": "symfony/yaml",
"version": "v3.0.2",
"version": "v3.0.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "3cf0709d7fe936e97bee9e954382e449003f1d9a"
"reference": "b5ba64cd67ecd6887f63868fa781ca094bd1377c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/3cf0709d7fe936e97bee9e954382e449003f1d9a",
"reference": "3cf0709d7fe936e97bee9e954382e449003f1d9a",
"url": "https://api.github.com/repos/symfony/yaml/zipball/b5ba64cd67ecd6887f63868fa781ca094bd1377c",
"reference": "b5ba64cd67ecd6887f63868fa781ca094bd1377c",
"shasum": ""
},
"require": {
@ -3126,7 +3128,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
"time": "2016-02-02 13:44:19"
"time": "2016-02-23 15:16:06"
},
{
"name": "theseer/fdomdocument",

View File

@ -1,2 +1,108 @@
<?php
// Here you can initialize variables that will be available to your tests
define("_JEXEC", 'true');
// Maximise error reporting.
error_reporting(E_ALL);
ini_set('display_errors', 1);
/*
* Ensure that required path constants are defined. These can be overridden within the phpunit.xml file
* if you chose to create a custom version of that file.
*/
if (!defined('JPATH_TESTS'))
{
define('JPATH_TESTS', realpath(__DIR__));
}
if (!defined('JPATH_TEST_DATABASE'))
{
define('JPATH_TEST_DATABASE', JPATH_TESTS . '/stubs/database');
}
if (!defined('JPATH_TEST_STUBS'))
{
define('JPATH_TEST_STUBS', JPATH_TESTS . '/stubs');
}
// Installation path of joomla, we use the cache directory here (Robo run testing site)..
if (!defined('JINSTALL_PATH'))
{
define('JINSTALL_PATH', dirname(JPATH_TESTS) . '/cache');
}
if (!defined('JPATH_PLATFORM'))
{
define('JPATH_PLATFORM', JINSTALL_PATH . '/libraries');
}
if (!defined('JPATH_LIBRARIES'))
{
define('JPATH_LIBRARIES', JINSTALL_PATH . '/libraries');
}
if (!defined('JPATH_BASE'))
{
define('JPATH_BASE', JINSTALL_PATH);
}
if (!defined('JPATH_ROOT'))
{
define('JPATH_ROOT', realpath(JPATH_BASE));
}
if (!defined('JPATH_CACHE'))
{
define('JPATH_CACHE', JPATH_BASE . '/cache');
}
if (!defined('JPATH_CONFIGURATION'))
{
define('JPATH_CONFIGURATION', JPATH_BASE);
}
if (!defined('JPATH_SITE'))
{
define('JPATH_SITE', JPATH_ROOT);
}
if (!defined('JPATH_ADMINISTRATOR'))
{
define('JPATH_ADMINISTRATOR', JPATH_ROOT . '/administrator');
}
if (!defined('JPATH_INSTALLATION'))
{
define('JPATH_INSTALLATION', JPATH_ROOT . '/installation');
}
if (!defined('JPATH_MANIFESTS'))
{
define('JPATH_MANIFESTS', JPATH_ADMINISTRATOR . '/manifests');
}
if (!defined('JPATH_PLUGINS'))
{
define('JPATH_PLUGINS', JPATH_BASE . '/plugins');
}
if (!defined('JPATH_THEMES'))
{
define('JPATH_THEMES', JPATH_BASE . '/templates');
}
if (!defined('JDEBUG'))
{
define('JDEBUG', false);
}
if (!defined('JPATH_COMPONENT_SITE'))
{
define('JPATH_COMPONENT_SITE', dirname(dirname(JPATH_BASE)) . '/src/component/com_weblinks');
}
if (!defined('JPATH_COMPONENT_ADMINISTRATOR'))
{
define('JPATH_COMPONENT_ADMINISTRATOR', dirname(dirname(JPATH_BASE)) . '/src/administrator/component/com_weblinks');
}
$_SERVER['HTTP_HOST'] = "localhost";
// Import the platform in legacy mode.
require_once JPATH_PLATFORM . '/import.legacy.php';
// Bootstrap the CMS libraries.
require_once JPATH_LIBRARIES . '/cms.php';
require_once JPATH_PLATFORM . '/platform.php';
require_once JPATH_PLATFORM . '/loader.php';
// Setup the autoloaders.
JLoader::setup();

View File

@ -0,0 +1,31 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_weblinks
*
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
class WeblinksHelperRouteTest extends \Codeception\TestCase\Test
{
/**
* @var \UnitTester
*/
protected $tester;
protected function _before()
{
require_once 'src/components/com_weblinks/helpers/route.php';
}
protected function _after()
{
}
// tests
public function testGetFormRouteNewWeblink()
{
$this->tester->assertContains('weblink.add&w_id=0', WeblinksHelperRoute::getFormRoute(null));
}
}