You are here

public function IssuesTest::test_extend_issue54 in Sassy 7

Same name and namespace in other branches
  1. 7.3 phpsass/tests/tests_issues.php \IssuesTest::test_extend_issue54()

File

phamlp/tests/tests_issues.php, line 21

Class

IssuesTest

Code

public function test_extend_issue54() {
  $source = <<<END
\$test-var: 1;

@mixin catch-my-error(\$align: right) {
\t\$align: unquote(\$align);
\t@if \$align == right {
\t\t.test-right-cls {
\t\t\ttext-align: right;
        }
    }
\t@else if \$align == left {
\t\t.test-left-cls {
\t\t\ttext-align: left;
        }
    }
    @else {
\t\t.test-else-cls {
\t\t\ttext-align: none;
        }
    }
}

.cls-1 {
\t@include catch-my-error(right);
}
.cls-2 {
\t@include catch-my-error(left);
}
.cls-3 {
\t@if \$test-var == 2 {
\t\tpadding: 10px;
    }
\t@else if \$test-var == 1 {
\t\t.test-1-cls {
\t\t\tpadding: 0;
        }
    }
}
END;
  $expected = <<<END
.cls-1 .test-right-cls {
  text-align: right;
}


.cls-2 .test-left-cls {
  text-align: left;
}


.cls-3 .test-1-cls {
  padding: 0;
}
END;
  $this
    ->assertScss($source, $expected);
}