Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dokuwiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BRIC
dokuwiki
Commits
e8da0265
Commit
e8da0265
authored
7 years ago
by
Yurii K
Browse files
Options
Downloads
Patches
Plain Diff
cleaning after better understanding of the surroundings
parent
e9d25488
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
_test/tests/lib/exe/css_at_import_less.test.php
+15
-22
15 additions, 22 deletions
_test/tests/lib/exe/css_at_import_less.test.php
with
15 additions
and
22 deletions
_test/tests/lib/exe/css_at_import_less.test.php
+
15
−
22
View file @
e8da0265
...
...
@@ -14,17 +14,17 @@ class css_at_import_less_test extends DokuWikiTest {
mkdir
(
$dir
,
0777
,
true
);
}
if
(
!
is_dir
(
$dir
))
{
th
row
new
Exception
(
'Could not create directory.'
);
$
th
is
->
markTestSkipped
(
'Could not create directory.'
);
}
$this
->
file
=
tempnam
(
$dir
,
'css'
);
$import
=
''
;
if
(
$import
)
unlink
(
$import
);
$import
=
tempnam
(
$dir
,
'less'
);
if
(
re
nam
e
(
$
import
,
$import
.
'.less'
)
===
false
)
{
throw
new
Exception
(
'failed to rename file
'
);
};
do
{
if
(
$import
)
unlink
(
$import
);
$import
=
temp
nam
(
$
dir
,
'less'
);
$ok
=
rename
(
$import
,
$import
.
'.less
'
);
}
while
(
!
$ok
)
;
$this
->
import
=
$import
.
'.less'
;
}
...
...
@@ -34,20 +34,19 @@ class css_at_import_less_test extends DokuWikiTest {
io_saveFile
(
$this
->
file
,
$input
);
$css
=
css_loadfile
(
$this
->
file
,
$location
);
$less
=
css_parseless
(
$css
);
$this
->
assertEquals
(
$expected_css
,
w2u
(
$css
)
)
;
// w2u() for test pass, less works with both slashes on Windows OS
$this
->
assertEquals
(
$expected_css
,
$css
);
$this
->
assertEquals
(
$expected_less
,
$less
);
}
// make relative
private
function
importPath
(
$path
)
{
return
isWindows
()
?
preg_replace
(
'#(^.*[\\\\])#'
,
''
,
$path
)
:
preg_replace
(
'#(^.*[/])#'
,
''
,
$path
);
}
public
function
test_basic
()
{
$this
->
setUpFiles
();
// remove path
if
(
isWindows
())
{
$import
=
preg_replace
(
'#(^.*[\\\\])#'
,
''
,
$this
->
import
);
}
else
{
$import
=
preg_replace
(
'#(^.*[/])#'
,
''
,
$this
->
import
);
}
$import
=
$this
->
importPath
(
$this
->
import
);
$in_css
=
'@import "'
.
$import
.
'";'
;
$in_less
=
'@foo: "bar";
content: @foo;'
;
...
...
@@ -62,18 +61,12 @@ content: @foo;';
public
function
test_subdirectory
()
{
$this
->
setUpFiles
(
'/foo/bar'
);
// remove path
if
(
isWindows
())
{
$import
=
preg_replace
(
'#(^.*[\\\\])#'
,
''
,
$this
->
import
);
}
else
{
$import
=
preg_replace
(
'#(^.*[/])#'
,
''
,
$this
->
import
);
}
$import
=
$this
->
importPath
(
$this
->
import
);
$in_css
=
'@import "'
.
$import
.
'";'
;
$in_less
=
'@foo: "bar";
content: @foo;'
;
$expected_css
=
'@import "/foo/bar/'
.
$import
.
'";'
;
$expected_css
=
isWindows
()
?
'@import "\\foo\\bar/'
.
$import
.
'";'
:
'@import "/foo/bar/'
.
$import
.
'";'
;
$expected_less
=
'content: "bar";'
;
io_saveFile
(
$this
->
import
,
$in_less
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment