-
Notifications
You must be signed in to change notification settings - Fork 34
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
50 changed files
with
2,233 additions
and
8 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
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,59 @@ | ||
sudo: required | ||
language: php | ||
addons: | ||
chrome: stable | ||
mariadb: '10.1' | ||
|
||
env: | ||
global: | ||
- PIMCORE_ENVIRONMENT=test | ||
- DACHCOM_BUNDLE_TEST=1 | ||
- PIMCORE_TEST_URL=http://localhost | ||
- CHROME_DRIVER_VERSION=2.41 | ||
- SELENIUM_VERSION=3.6.0 | ||
- WEBDRIVER_HOST=localhost | ||
- WEBDRIVER_URL="http://localhost:8080/" | ||
- PIMCORE_TEST_DB_DSN="mysql://root@localhost/dachcom_bundle_test" | ||
- SYMFONY_DEPRECATIONS_HELPER=weak | ||
matrix: | ||
include: | ||
- sudo: required | ||
php: 7.1 | ||
env: | ||
# pimcore 5.4.x | ||
- PIMCORE_SKELETON_BRANCH="tags/v1.0.4" | ||
- sudo: required | ||
php: 7.2 | ||
env: | ||
- PIMCORE_SKELETON_BRANCH="tags/v1.0.4" | ||
- sudo: required | ||
php: 7.1 | ||
env: | ||
# pimcore 5.5.x | ||
- PIMCORE_SKELETON_BRANCH="tags/v1.0.5" | ||
- sudo: required | ||
php: 7.2 | ||
env: | ||
- PIMCORE_SKELETON_BRANCH="tags/v1.0.5" | ||
fast_finish: true | ||
|
||
cache: | ||
directories: | ||
- $HOME/.composer/cache | ||
|
||
install: | ||
- tests/etc/travis/install | ||
|
||
after_failure: | ||
- cd $TRAVIS_BUILD_DIR | ||
- cat ./lib/Members/tests/_output/* | ||
|
||
script: | ||
- '$HOME/chromedriver --url-base=/wd/hub &' | ||
- 'php ${TRAVIS_BUILD_DIR}/bin/console server:start 127.0.0.1:8080' | ||
- 'php ${TRAVIS_BUILD_DIR}/bin/console server:status' | ||
- etc/travis/script | ||
|
||
notifications: | ||
email: | ||
- [email protected] |
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 @@ | ||
settings: | ||
memory_limit: -1 | ||
colors: true | ||
paths: | ||
log: var/logs | ||
include: | ||
- tests |
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
Empty file.
Empty file.
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,10 @@ | ||
modules: | ||
config: | ||
\DachcomBundle\Test\Helper\Browser\WebDriver: | ||
browser: chrome | ||
port: 9515 | ||
capabilities: | ||
chromeOptions: | ||
args: ['--headless', '--disable-gpu', '--no-sandbox', '--window-size=1024,768'] | ||
prefs: | ||
download.default_directory: '%TRAVIS_BUILD_DIR%/lib/Members/tests/_data/downloads' |
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,13 @@ | ||
<?php | ||
|
||
namespace DachcomBundle\Test; | ||
|
||
/** | ||
* Class AcceptanceTester | ||
* | ||
* @package DachcomBundle\Test | ||
*/ | ||
class AcceptanceTester extends \Codeception\Actor | ||
{ | ||
use _generated\AcceptanceTesterActions; | ||
} |
Empty file.
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,62 @@ | ||
<?php | ||
|
||
namespace DachcomBundle\Test\App; | ||
|
||
use Pimcore\Kernel; | ||
use Symfony\Component\Config\Loader\LoaderInterface; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
|
||
class TestAppKernel extends Kernel | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function registerContainerConfiguration(LoaderInterface $loader) | ||
{ | ||
parent::registerContainerConfiguration($loader); | ||
|
||
$bundleClass = getenv('DACHCOM_BUNDLE_HOME'); | ||
$bundleName = getenv('DACHCOM_BUNDLE_NAME'); | ||
$configName = getenv('DACHCOM_BUNDLE_CONFIG_FILE'); | ||
|
||
if ($configName !== false) { | ||
\Codeception\Util\Debug::debug(sprintf('[%s] add custom config file %s', strtoupper($bundleName), $configName)); | ||
$loader->load($bundleClass . '/etc/config/bundle/symfony/' . $configName); | ||
} | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function registerBundlesToCollection(\Pimcore\HttpKernel\BundleCollection\BundleCollection $collection) | ||
{ | ||
if (class_exists('\\AppBundle\\AppBundle')) { | ||
$collection->addBundle(new \AppBundle\AppBundle()); | ||
} | ||
|
||
$collection->addBundle(new \Symfony\Bundle\WebProfilerBundle\WebProfilerBundle()); | ||
|
||
$bundleClass = getenv('DACHCOM_BUNDLE_CLASS'); | ||
$collection->addBundle(new $bundleClass()); | ||
} | ||
|
||
/** | ||
* @param ContainerBuilder $container | ||
*/ | ||
protected function build(ContainerBuilder $container) | ||
{ | ||
$container->addCompilerPass(new \DachcomBundle\Test\DependencyInjection\MakeServicesPublicPass(), | ||
\Symfony\Component\DependencyInjection\Compiler\PassConfig::TYPE_BEFORE_OPTIMIZATION, -100000); | ||
$container->addCompilerPass(new \DachcomBundle\Test\DependencyInjection\MonologChannelLoggerPass(), | ||
\Symfony\Component\DependencyInjection\Compiler\PassConfig::TYPE_BEFORE_OPTIMIZATION, 1); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function boot() | ||
{ | ||
parent::boot(); | ||
\Pimcore::setKernel($this); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
tests/_support/DependencyInjection/MakeServicesPublicPass.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,30 @@ | ||
<?php | ||
|
||
namespace DachcomBundle\Test\DependencyInjection; | ||
|
||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
|
||
class MakeServicesPublicPass implements CompilerPassInterface | ||
{ | ||
/** | ||
* @param ContainerBuilder $container | ||
*/ | ||
public function process(ContainerBuilder $container) | ||
{ | ||
$prefix = getenv('DACHCOM_BUNDLE_NAME'); | ||
$serviceIds = array_filter($container->getServiceIds(), function (string $id) use ($prefix) { | ||
return strpos($id, $prefix) === 0; | ||
}); | ||
|
||
foreach ($serviceIds as $serviceId) { | ||
if ($container->hasAlias($serviceId)) { | ||
$container->getAlias($serviceId)->setPublic(true); | ||
} | ||
|
||
$container | ||
->findDefinition($serviceId) | ||
->setPublic(true); | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
tests/_support/DependencyInjection/MonologChannelLoggerPass.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,27 @@ | ||
<?php | ||
|
||
namespace DachcomBundle\Test\DependencyInjection; | ||
|
||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | ||
use Symfony\Component\DependencyInjection\ContainerBuilder; | ||
|
||
class MonologChannelLoggerPass implements CompilerPassInterface | ||
{ | ||
public function process(ContainerBuilder $container) | ||
{ | ||
$channelsToHide = [ | ||
'event', | ||
'doctrine', | ||
'console', | ||
'cache', | ||
'pimcore' | ||
]; | ||
|
||
$monologHandlers = $container->getParameter('monolog.handlers_to_channels'); | ||
foreach ($channelsToHide as $channelToHide) { | ||
$monologHandlers['monolog.handler.console']['elements'][] = $channelToHide; | ||
} | ||
|
||
$container->setParameter('monolog.handlers_to_channels', $monologHandlers); | ||
} | ||
} |
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,13 @@ | ||
<?php | ||
|
||
namespace DachcomBundle\Test; | ||
|
||
/** | ||
* Class FunctionalTester | ||
* | ||
* @package DachcomBundle\Test | ||
*/ | ||
class FunctionalTester extends \Codeception\Actor | ||
{ | ||
use _generated\FunctionalTesterActions; | ||
} |
Oops, something went wrong.