|
|
|
@ -383,7 +383,29 @@ class ThemingControllerTest extends TestCase {
|
|
|
|
|
$expectedData .= 'input[type="radio"].radio:checked:not(.radio--white):not(:disabled) + label:before {' .
|
|
|
|
|
'background-image: url(\'data:image/svg+xml;base64,'.$this->util->generateRadioButton($color).'\');' .
|
|
|
|
|
"}\n";
|
|
|
|
|
|
|
|
|
|
$expectedData .= '.primary, input[type="submit"].primary, input[type="button"].primary, button.primary, .button.primary,' .
|
|
|
|
|
'.primary:active, input[type="submit"].primary:active, input[type="button"].primary:active, button.primary:active, .button.primary:active,' .
|
|
|
|
|
'.primary:disabled, input[type="submit"].primary:disabled, input[type="button"].primary:disabled, button.primary:disabled, .button.primary:disabled,' .
|
|
|
|
|
'.primary:disabled:hover, input[type="submit"].primary:disabled:hover, input[type="button"].primary:disabled:hover, button.primary:disabled:hover, .button.primary:disabled:hover,' .
|
|
|
|
|
'.primary:disabled:focus, input[type="submit"].primary:disabled:focus, input[type="button"].primary:disabled:focus, button.primary:disabled:focus, .button.primary:disabled:focus {' .
|
|
|
|
|
'border: 1px solid '.$color .';'.
|
|
|
|
|
'background-color: '.$color.';'.
|
|
|
|
|
'opacity: 0.8' .
|
|
|
|
|
"}\n" .
|
|
|
|
|
'.primary:hover, input[type="submit"].primary:hover, input[type="button"].primary:hover, button.primary:hover, .button.primary:hover,' .
|
|
|
|
|
'.primary:focus, input[type="submit"].primary:focus, input[type="button"].primary:focus, button.primary:focus, .button.primary:focus {' .
|
|
|
|
|
'border: 1px solid '.$color.';'.
|
|
|
|
|
'background-color: '.$color.';'.
|
|
|
|
|
'opacity: 1.0;' .
|
|
|
|
|
"}\n";
|
|
|
|
|
$expectedData .= '.ui-widget-header { border: 1px solid ' . $color . '; background: '. $color . '; color: #ffffff;' . "}\n";
|
|
|
|
|
$expectedData .= '.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {' .
|
|
|
|
|
'border: 1px solid ' . $color . ';' .
|
|
|
|
|
'color: ' . $color . ';' .
|
|
|
|
|
"}\n";
|
|
|
|
|
$expectedData .= '.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited {' .
|
|
|
|
|
'color: ' . $color . ';' .
|
|
|
|
|
"}\n";
|
|
|
|
|
$expectedData .= '
|
|
|
|
|
#firstrunwizard .firstrunwizard-header {
|
|
|
|
|
background-color: ' . $color . ';
|
|
|
|
@ -406,6 +428,7 @@ class ThemingControllerTest extends TestCase {
|
|
|
|
|
public function testGetStylesheetWithOnlyColorInvert() {
|
|
|
|
|
|
|
|
|
|
$color = '#fff';
|
|
|
|
|
$elementColor = '#555555';
|
|
|
|
|
|
|
|
|
|
$this->config
|
|
|
|
|
->expects($this->at(0))
|
|
|
|
@ -442,7 +465,29 @@ class ThemingControllerTest extends TestCase {
|
|
|
|
|
$expectedData .= 'input[type="radio"].radio:checked:not(.radio--white):not(:disabled) + label:before {' .
|
|
|
|
|
'background-image: url(\'data:image/svg+xml;base64,'.$this->util->generateRadioButton('#555555').'\');' .
|
|
|
|
|
"}\n";
|
|
|
|
|
|
|
|
|
|
$expectedData .= '.primary, input[type="submit"].primary, input[type="button"].primary, button.primary, .button.primary,' .
|
|
|
|
|
'.primary:active, input[type="submit"].primary:active, input[type="button"].primary:active, button.primary:active, .button.primary:active,' .
|
|
|
|
|
'.primary:disabled, input[type="submit"].primary:disabled, input[type="button"].primary:disabled, button.primary:disabled, .button.primary:disabled,' .
|
|
|
|
|
'.primary:disabled:hover, input[type="submit"].primary:disabled:hover, input[type="button"].primary:disabled:hover, button.primary:disabled:hover, .button.primary:disabled:hover,' .
|
|
|
|
|
'.primary:disabled:focus, input[type="submit"].primary:disabled:focus, input[type="button"].primary:disabled:focus, button.primary:disabled:focus, .button.primary:disabled:focus {' .
|
|
|
|
|
'border: 1px solid #555555;'.
|
|
|
|
|
'background-color: #555555;'.
|
|
|
|
|
'opacity: 0.8' .
|
|
|
|
|
"}\n" .
|
|
|
|
|
'.primary:hover, input[type="submit"].primary:hover, input[type="button"].primary:hover, button.primary:hover, .button.primary:hover,' .
|
|
|
|
|
'.primary:focus, input[type="submit"].primary:focus, input[type="button"].primary:focus, button.primary:focus, .button.primary:focus {' .
|
|
|
|
|
'border: 1px solid #555555;'.
|
|
|
|
|
'background-color: #555555;'.
|
|
|
|
|
'opacity: 1.0;' .
|
|
|
|
|
"}\n";
|
|
|
|
|
$expectedData .= '.ui-widget-header { border: 1px solid ' . $color . '; background: '. $color . '; color: #ffffff;' . "}\n";
|
|
|
|
|
$expectedData .= '.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {' .
|
|
|
|
|
'border: 1px solid ' . $color . ';' .
|
|
|
|
|
'color: ' . $elementColor . ';' .
|
|
|
|
|
"}\n";
|
|
|
|
|
$expectedData .= '.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited {' .
|
|
|
|
|
'color: ' . $elementColor . ';' .
|
|
|
|
|
"}\n";
|
|
|
|
|
$expectedData .= '
|
|
|
|
|
#firstrunwizard .firstrunwizard-header {
|
|
|
|
|
background-color: ' . $color . ';
|
|
|
|
@ -458,6 +503,7 @@ class ThemingControllerTest extends TestCase {
|
|
|
|
|
$expectedData .= '.searchbox input[type="search"] { background: transparent url(\'' . \OC::$WEBROOT . '/core/img/actions/search.svg\') no-repeat 6px center; color: #000; }' . "\n";
|
|
|
|
|
$expectedData .= '.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid { color: #000; border: 1px solid rgba(0, 0, 0, .5); }' . "\n";
|
|
|
|
|
$expectedData .= '.nc-theming-contrast {color: #000000}' . "\n";
|
|
|
|
|
$expectedData .= '.ui-widget-header { color: #000000; }' . "\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$expected = new Http\DataDownloadResponse($expectedData, 'style', 'text/css');
|
|
|
|
@ -585,6 +631,29 @@ class ThemingControllerTest extends TestCase {
|
|
|
|
|
$expectedData .= 'input[type="radio"].radio:checked:not(.radio--white):not(:disabled) + label:before {' .
|
|
|
|
|
'background-image: url(\'data:image/svg+xml;base64,'.$this->util->generateRadioButton($color).'\');' .
|
|
|
|
|
"}\n";
|
|
|
|
|
$expectedData .= '.primary, input[type="submit"].primary, input[type="button"].primary, button.primary, .button.primary,' .
|
|
|
|
|
'.primary:active, input[type="submit"].primary:active, input[type="button"].primary:active, button.primary:active, .button.primary:active,' .
|
|
|
|
|
'.primary:disabled, input[type="submit"].primary:disabled, input[type="button"].primary:disabled, button.primary:disabled, .button.primary:disabled,' .
|
|
|
|
|
'.primary:disabled:hover, input[type="submit"].primary:disabled:hover, input[type="button"].primary:disabled:hover, button.primary:disabled:hover, .button.primary:disabled:hover,' .
|
|
|
|
|
'.primary:disabled:focus, input[type="submit"].primary:disabled:focus, input[type="button"].primary:disabled:focus, button.primary:disabled:focus, .button.primary:disabled:focus {' .
|
|
|
|
|
'border: 1px solid '.$color .';'.
|
|
|
|
|
'background-color: '.$color.';'.
|
|
|
|
|
'opacity: 0.8' .
|
|
|
|
|
"}\n" .
|
|
|
|
|
'.primary:hover, input[type="submit"].primary:hover, input[type="button"].primary:hover, button.primary:hover, .button.primary:hover,' .
|
|
|
|
|
'.primary:focus, input[type="submit"].primary:focus, input[type="button"].primary:focus, button.primary:focus, .button.primary:focus {' .
|
|
|
|
|
'border: 1px solid '.$color.';'.
|
|
|
|
|
'background-color: '.$color.';'.
|
|
|
|
|
'opacity: 1.0;' .
|
|
|
|
|
"}\n";
|
|
|
|
|
$expectedData .= '.ui-widget-header { border: 1px solid ' . $color . '; background: '. $color . '; color: #ffffff;' . "}\n";
|
|
|
|
|
$expectedData .= '.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {' .
|
|
|
|
|
'border: 1px solid ' . $color . ';' .
|
|
|
|
|
'color: ' . $color . ';' .
|
|
|
|
|
"}\n";
|
|
|
|
|
$expectedData .= '.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited {' .
|
|
|
|
|
'color: ' . $color . ';' .
|
|
|
|
|
"}\n";
|
|
|
|
|
$expectedData .= '
|
|
|
|
|
#firstrunwizard .firstrunwizard-header {
|
|
|
|
|
background-color: ' . $color . ';
|
|
|
|
@ -624,6 +693,7 @@ class ThemingControllerTest extends TestCase {
|
|
|
|
|
public function testGetStylesheetWithAllCombinedInverted() {
|
|
|
|
|
|
|
|
|
|
$color = '#fff';
|
|
|
|
|
$elementColor = '#555555';
|
|
|
|
|
|
|
|
|
|
$this->config
|
|
|
|
|
->expects($this->at(0))
|
|
|
|
@ -646,7 +716,6 @@ class ThemingControllerTest extends TestCase {
|
|
|
|
|
->with('theming', 'backgroundMime', '')
|
|
|
|
|
->willReturn('image/png');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$expectedData = sprintf(
|
|
|
|
|
'#body-user #header,#body-settings #header,#body-public #header,#body-login,.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid {background-color: %s}' . "\n",
|
|
|
|
|
$color);
|
|
|
|
@ -661,6 +730,29 @@ class ThemingControllerTest extends TestCase {
|
|
|
|
|
$expectedData .= 'input[type="radio"].radio:checked:not(.radio--white):not(:disabled) + label:before {' .
|
|
|
|
|
'background-image: url(\'data:image/svg+xml;base64,'.$this->util->generateRadioButton('#555555').'\');' .
|
|
|
|
|
"}\n";
|
|
|
|
|
$expectedData .= '.primary, input[type="submit"].primary, input[type="button"].primary, button.primary, .button.primary,' .
|
|
|
|
|
'.primary:active, input[type="submit"].primary:active, input[type="button"].primary:active, button.primary:active, .button.primary:active,' .
|
|
|
|
|
'.primary:disabled, input[type="submit"].primary:disabled, input[type="button"].primary:disabled, button.primary:disabled, .button.primary:disabled,' .
|
|
|
|
|
'.primary:disabled:hover, input[type="submit"].primary:disabled:hover, input[type="button"].primary:disabled:hover, button.primary:disabled:hover, .button.primary:disabled:hover,' .
|
|
|
|
|
'.primary:disabled:focus, input[type="submit"].primary:disabled:focus, input[type="button"].primary:disabled:focus, button.primary:disabled:focus, .button.primary:disabled:focus {' .
|
|
|
|
|
'border: 1px solid #555555;'.
|
|
|
|
|
'background-color: #555555;'.
|
|
|
|
|
'opacity: 0.8' .
|
|
|
|
|
"}\n" .
|
|
|
|
|
'.primary:hover, input[type="submit"].primary:hover, input[type="button"].primary:hover, button.primary:hover, .button.primary:hover,' .
|
|
|
|
|
'.primary:focus, input[type="submit"].primary:focus, input[type="button"].primary:focus, button.primary:focus, .button.primary:focus {' .
|
|
|
|
|
'border: 1px solid #555555;'.
|
|
|
|
|
'background-color: #555555;'.
|
|
|
|
|
'opacity: 1.0;' .
|
|
|
|
|
"}\n";
|
|
|
|
|
$expectedData .= '.ui-widget-header { border: 1px solid ' . $color . '; background: '. $color . '; color: #ffffff;' . "}\n";
|
|
|
|
|
$expectedData .= '.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active {' .
|
|
|
|
|
'border: 1px solid ' . $color . ';' .
|
|
|
|
|
'color: ' . $elementColor . ';' .
|
|
|
|
|
"}\n";
|
|
|
|
|
$expectedData .= '.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited {' .
|
|
|
|
|
'color: ' . $elementColor . ';' .
|
|
|
|
|
"}\n";
|
|
|
|
|
$expectedData .= '
|
|
|
|
|
#firstrunwizard .firstrunwizard-header {
|
|
|
|
|
background-color: ' . $color . ';
|
|
|
|
@ -694,8 +786,9 @@ class ThemingControllerTest extends TestCase {
|
|
|
|
|
$expectedData .= '.searchbox input[type="search"] { background: transparent url(\'' . \OC::$WEBROOT . '/core/img/actions/search.svg\') no-repeat 6px center; color: #000; }' . "\n";
|
|
|
|
|
$expectedData .= '.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid { color: #000; border: 1px solid rgba(0, 0, 0, .5); }' . "\n";
|
|
|
|
|
$expectedData .= '.nc-theming-contrast {color: #000000}' . "\n";
|
|
|
|
|
$expected = new Http\DataDownloadResponse($expectedData, 'style', 'text/css');
|
|
|
|
|
$expectedData .= '.ui-widget-header { color: #000000; }' . "\n";
|
|
|
|
|
|
|
|
|
|
$expected = new Http\DataDownloadResponse($expectedData, 'style', 'text/css');
|
|
|
|
|
$expected->cacheFor(3600);
|
|
|
|
|
$expected->addHeader('Expires', date(\DateTime::RFC2822, 123));
|
|
|
|
|
@$this->assertEquals($expected, $this->themingController->getStylesheet());
|
|
|
|
|