Skip to content

Commit 8600998

Browse files
committed
EZP-21949: Fixed ImageMagick related fails on Travis
1 parent a2bbcec commit 8600998

File tree

5 files changed

+26
-7
lines changed

5 files changed

+26
-7
lines changed

bootstrap.php

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ function ()
5858
// Exposing in env variables in order be able to use them in test cases.
5959
$_ENV['legacyKernel'] = $legacyKernel;
6060
$_ENV['legacyPath'] = $settings['service']['parameters']['legacy_dir'];
61+
$_ENV['imagemagickConvertPath'] = $settings['service']['parameters']['imagemagick_convert_path'];
6162
}
6263

6364
return include 'container.php';

config.php-DEVELOPMENT

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ return array(
6161
getcwd() . '/ezpublish_legacy' :
6262
__DIR__ . '/vendor/ezsystems/ezpublish-legacy'
6363
),
64+
'imagemagick_convert_path' => '/usr/bin/convert'
6465
)
6566
)
6667
);

eZ/Bundle/EzPublishCoreBundle/Tests/DependencyInjection/EzPublishCoreExtensionTest.php

+22-3
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,40 @@ public function testSiteAccessNoConfiguration()
9696

9797
public function testImageMagickConfigurationBasic()
9898
{
99-
$this->load();
99+
if ( !isset( $_ENV['imagemagickConvertPath'] ) || !is_executable( $_ENV['imagemagickConvertPath'] ) )
100+
{
101+
$this->markTestSkipped( 'Missing or mis-configured Imagemagick convert path.' );
102+
}
103+
104+
$this->load(
105+
array(
106+
'imagemagick' => array(
107+
'enabled' => true,
108+
'path' => $_ENV['imagemagickConvertPath']
109+
)
110+
)
111+
);
100112
$this->assertContainerBuilderHasParameter( 'ezpublish.image.imagemagick.enabled', true );
101-
$this->assertContainerBuilderHasParameter( 'ezpublish.image.imagemagick.executable_path', dirname( $this->minimalConfig['imagemagick']['path'] ) );
102-
$this->assertContainerBuilderHasParameter( 'ezpublish.image.imagemagick.executable', basename( $this->minimalConfig['imagemagick']['path'] ) );
113+
$this->assertContainerBuilderHasParameter( 'ezpublish.image.imagemagick.executable_path', dirname( $_ENV['imagemagickConvertPath'] ) );
114+
$this->assertContainerBuilderHasParameter( 'ezpublish.image.imagemagick.executable', basename( $_ENV['imagemagickConvertPath'] ) );
103115
}
104116

105117
public function testImageMagickConfigurationFilters()
106118
{
119+
if ( !isset( $_ENV['imagemagickConvertPath'] ) || !is_executable( $_ENV['imagemagickConvertPath'] ) )
120+
{
121+
$this->markTestSkipped( 'Missing or mis-configured Imagemagick convert path.' );
122+
}
123+
107124
$customFilters = array(
108125
'foobar' => '-foobar',
109126
'wow' => '-amazing'
110127
);
111128
$this->load(
112129
array(
113130
'imagemagick' => array(
131+
'enabled' => true,
132+
'path' => $_ENV['imagemagickConvertPath'],
114133
'filters' => $customFilters
115134
)
116135
)

eZ/Bundle/EzPublishCoreBundle/Tests/DependencyInjection/Fixtures/ezpublish_minimal.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ siteaccess:
2222
the_back: ezdemo_site_admin
2323

2424
imagemagick:
25-
enabled: true
26-
path: /opt/local/bin/convert
25+
enabled: false
2726

2827
http_cache:
2928
purge_type: local

eZ/Bundle/EzPublishCoreBundle/Tests/DependencyInjection/Fixtures/ezpublish_minimal_no_siteaccess.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
imagemagick:
2-
enabled: true
3-
path: /opt/local/bin/convert
2+
enabled: false
43

54
http_cache:
65
purge_type: local

0 commit comments

Comments
 (0)