From b404346e664a3723803ba68b0fc7e5e617df4530 Mon Sep 17 00:00:00 2001 From: Eugene Matvejev Date: Sun, 26 Jun 2016 10:56:24 +0100 Subject: [PATCH 1/2] update test fixtures --- tests/shared-fixtures/compass/app.scss | 16 -- tests/shared-fixtures/compass/compass.scss | 1 + tests/shared-fixtures/integration/app.scss | 3 + .../sass/layout-loading-animation.sass | 46 +++++ .../sass/layout-loading-animation.scss | 58 ------ tests/shared-fixtures/sass/layout.scss | 181 ------------------ .../{compass/sass => scss}/layout.scss | 0 7 files changed, 50 insertions(+), 255 deletions(-) delete mode 100644 tests/shared-fixtures/compass/app.scss create mode 100644 tests/shared-fixtures/compass/compass.scss create mode 100644 tests/shared-fixtures/integration/app.scss create mode 100644 tests/shared-fixtures/sass/layout-loading-animation.sass delete mode 100644 tests/shared-fixtures/sass/layout-loading-animation.scss delete mode 100644 tests/shared-fixtures/sass/layout.scss rename tests/shared-fixtures/{compass/sass => scss}/layout.scss (100%) diff --git a/tests/shared-fixtures/compass/app.scss b/tests/shared-fixtures/compass/app.scss deleted file mode 100644 index 28ded83..0000000 --- a/tests/shared-fixtures/compass/app.scss +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Welcome to Compass. - * In this file you should write your main styles. (or centralize your imports) - * Import this file using the following HTML or equivalent: - * - */ - -/* @import "compass/reset"; */ - -@import "compass/reset"; -@import "sass/layout"; -@import "sass/layout-loading-animation"; -//@import "layout-loading-animation"; -// -//@import "game"; -//@import "game-results"; diff --git a/tests/shared-fixtures/compass/compass.scss b/tests/shared-fixtures/compass/compass.scss new file mode 100644 index 0000000..a7201d9 --- /dev/null +++ b/tests/shared-fixtures/compass/compass.scss @@ -0,0 +1 @@ +@import "compass/reset"; diff --git a/tests/shared-fixtures/integration/app.scss b/tests/shared-fixtures/integration/app.scss new file mode 100644 index 0000000..9307b05 --- /dev/null +++ b/tests/shared-fixtures/integration/app.scss @@ -0,0 +1,3 @@ +@import "../compass"; +@import "../scss/layout"; +@import "../sass/layout-loading-animation"; diff --git a/tests/shared-fixtures/sass/layout-loading-animation.sass b/tests/shared-fixtures/sass/layout-loading-animation.sass new file mode 100644 index 0000000..d91b723 --- /dev/null +++ b/tests/shared-fixtures/sass/layout-loading-animation.sass @@ -0,0 +1,46 @@ +.loading-animation + position: relative + width: 57px + + span + animation: loading-animation 1.5s infinite ease-in-out + background: #9b59b6 + bottom: 0 + display: block + height: 5px + position: absolute + width: 9px + + &:nth-child(2) + animation-delay: .2s + left: 11px + + &:nth-child(3) + animation-delay: .4s + left: 22px + + &:nth-child(4) + animation-delay: .6s + left: 33px + + &:nth-child(5) + animation-delay: .8s + left: 44px + +@keyframes loading-animation + 0% + height: 5px + transform: translateY(0px) + background: #9b59b6 + 25% + height: 30px + transform: translateY(15px) + background: #3498db + 50% + height: 5px + transform: translateY(0px) + background: #9b59b6 + 100% + height: 5px + transform: translateY(0px) + background: #9b59b6 diff --git a/tests/shared-fixtures/sass/layout-loading-animation.scss b/tests/shared-fixtures/sass/layout-loading-animation.scss deleted file mode 100644 index c67b62b..0000000 --- a/tests/shared-fixtures/sass/layout-loading-animation.scss +++ /dev/null @@ -1,58 +0,0 @@ -.loading-animation { - position: relative; - width: 57px; - - span { - animation: loading-animation 1.5s infinite ease-in-out; - background: #9b59b6; - bottom: 0; - display: block; - height: 5px; - position: absolute; - width: 9px; - - &:nth-child(2) { - animation-delay: .2s; - left: 11px; - } - - &:nth-child(3) { - animation-delay: .4s; - left: 22px; - } - - &:nth-child(4) { - animation-delay: .6s; - left: 33px; - } - - &:nth-child(5) { - animation-delay: .8s; - left: 44px; - } - - } -} - -@keyframes loading-animation { - 0% { - height: 5px; - transform: translateY(0px); - background: #9b59b6; - } - 25% { - height: 30px; - transform: translateY(15px); - background: #3498db; - } - 50% { - height: 5px; - transform: translateY(0px); - background: #9b59b6; - } - 100% { - height: 5px; - transform: translateY(0px); - background: #9b59b6; - } -} diff --git a/tests/shared-fixtures/sass/layout.scss b/tests/shared-fixtures/sass/layout.scss deleted file mode 100644 index 7a2f1da..0000000 --- a/tests/shared-fixtures/sass/layout.scss +++ /dev/null @@ -1,181 +0,0 @@ -body { - height: 100%; - color: #333; - font-family: 'Lato', sans-serif; - font-size: 16px; - line-height: 1.42857; - /*background: linear-gradient(135deg, #99aaa0 0%,#d197b3 33%,#e5c2c4 65%,#76588c 100%) center center / cover fixed; !* W3C *!*/ - /*background: linear-gradient(135deg, rgba(15,11,11,1) 0%,rgba(234,132,7,1) 100%) center center / cover fixed; !* W3C *!*/ - /*background: linear-gradient(135deg, rgba(173,28,52,1) 0%, rgba(237,211,220,1) 100%) center center / cover fixed; !* W3C *! */ - /*background: linear-gradient(to bottom, rgba(135,224,253,1) 0%,rgba(83,203,241,1) 40%,rgba(5,171,224,1) 100%) center center / cover fixed;*/ - - background: linear-gradient(to bottom, rgb(32, 23, 99) 0%, rgb(31, 19, 95) 40%, #a94442 100%) center center / cover fixed; - - & > .container { - width: 100%; - height: 100%; - padding: 0; - margin: 0; - } -} - -.page-sidebar, -.page-content { - transition: all 0.5s ease; - color: #fff; -} - -.page-sidebar { - position: fixed; - height: 100%; - left: 0; - z-index: 1000; - overflow-y: auto; - /*background: linear-gradient(to bottom, #b26cab 0%,#765c8b 100%); !* W3C *!*/ - background: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.5) 50%, rgba(255, 255, 255, 0) 100%); - border-right: 1px solid #fff; -} - -.page-sidebar, -.sidebar-nav > li { - width: 250px; -} - -.page-sidebar.toggled { - width: 0; -} - -.page-content { - padding-left: 275px; - - &.toggled { - padding-left: 25px; - - .toggle-btn { - opacity: 1; - } - } - &:not(.toggled) .toggle-btn { - opacity: 0; - } -} - -.toggle-btn { - cursor: pointer; -} - -.page-header { - font-size: 24px; - margin: 0; - padding: 40px 0 0 20px; - - &, - & > span { - line-height: 32px; - height: 75px; - } - -} - -.sidebar-nav { - list-style-type: none; - padding: 0; - margin: 0; - - & > li { - &.sidebar-brand span { - float: right; - padding-right: 10px; - } - - &:not(.sidebar-brand) { - padding: 10px 15px; - font-size: 16px; - text-align: right; - text-transform: uppercase; - background: transparent; - clear: both; - } - } - - & > li.selected, - & > li:not(.sidebar-brand):not(.no-hover):hover { - background: #fff; - color: #000; - } - & > li:not(.sidebar-brand):not(.selected):hover { - cursor: pointer; - } -} - -.page-content:not(.toggled) .toggle-btn { - opacity: 0; -} - -.page-loading { - background: rgba(2, 2, 2, 0.5); - z-index: 10002; - width: 100%; - height: 100%; - position: absolute; - - & > .loading-animation { - margin: auto; - top: 50%; - zoom: 4; - } -} - -.no-scroll-mode { - position: fixed; -} - -#notification-area { - width: calc(100% - 50px); - border: 1px solid; - min-height: 100px; - position: absolute; - border-radius: 10px; - - font-size: 72px; - z-index: 1; - text-align: center; - font-style: italic; -} - -#notification-area > .notification-control { - float: right; - margin: 10px; - font-size: 24px; - - &:hover { - font-weight: bolder; - cursor: pointer; - } -} - -#modal-area { - color: #000; - h4, label { - text-transform: uppercase; - } - - .help-block { - font-size: 14px; - font-style: italic; - } -} - -.container-fluid { - padding-left: 0; - padding-right: 0; - padding-bottom: 25px; -} - -.pagination-area { - text-align: center; -} - -a.history-title { - color: #F5DEB3; -} diff --git a/tests/shared-fixtures/compass/sass/layout.scss b/tests/shared-fixtures/scss/layout.scss similarity index 100% rename from tests/shared-fixtures/compass/sass/layout.scss rename to tests/shared-fixtures/scss/layout.scss From 4a513b9d3192f300dabbf2fffbc82d1f9d4fedff Mon Sep 17 00:00:00 2001 From: Eugene Matvejev Date: Sun, 26 Jun 2016 11:10:53 +0100 Subject: [PATCH 2/2] fix tests --- tests/phpunit/Processor/ProcessorTest.php | 26 +++++++++-------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/tests/phpunit/Processor/ProcessorTest.php b/tests/phpunit/Processor/ProcessorTest.php index cadd335..a866a1f 100644 --- a/tests/phpunit/Processor/ProcessorTest.php +++ b/tests/phpunit/Processor/ProcessorTest.php @@ -28,16 +28,16 @@ protected function setUp() public function attachFiles() { $paths = [ - static::getSharedFixturesDirectory() . '/sass', - static::getSharedFixturesDirectory() . '/compass' + static::getSharedFixturesDirectory() . '/sass' => 1, + static::getSharedFixturesDirectory() . '/compass' => 1, + static::getSharedFixturesDirectory() . '/scss' => 3, + static::getSharedFixturesDirectory() . '/scss/layout.scss' => 1 ]; - $cacheDir = dirname(dirname(__DIR__)) . '/var/cache'; - - foreach ($paths as $path) { + foreach ($paths as $path => $expectedFiles) { $processor = new Processor($this->io); - $processor->attachFiles($path, $cacheDir); + $processor->attachFiles($path, ''); - $this->assertCount(2, $processor->getFiles()); + $this->assertCount($expectedFiles, $processor->getFiles()); } } @@ -49,13 +49,7 @@ public function attachFiles() */ public function attachFilesExpectedException() { - $path = static::getSharedFixturesDirectory() . '/do-not-exists'; - $cacheDir = dirname(dirname(__DIR__)) . '/var/cache'; - - $processor = new Processor($this->io); - $processor->attachFiles($path, $cacheDir); - - $this->assertCount(2, $processor->getFiles()); + (new Processor($this->io))->attachFiles(static::getSharedFixturesDirectory() . '/do-not-exists', ''); } /** @@ -64,7 +58,7 @@ public function attachFilesExpectedException() */ public function processFileSASS() { - $file = (new FileContainer(static::getSharedFixturesDirectory() . '/compass/sass/layout.scss', '')) + $file = (new FileContainer(static::getSharedFixturesDirectory() . '/scss/layout.scss', '')) ->setSourceContentFromSourcePath(); (new Processor($this->io))->processFile($file); @@ -80,7 +74,7 @@ public function processFileSASS() */ public function processFileExpectedException() { - $file = (new FileContainer(static::getSharedFixturesDirectory() . '/compass/sass/', '')) + $file = (new FileContainer(static::getSharedFixturesDirectory() . '/compass', '')) ->setSourceContentFromSourcePath() ->setType(FileContainer::TYPE_UNKNOWN);