You are here

class IssuesTest in Sassy 7

Same name in this branch
  1. 7 phamlp/tests/tests_compass.php \IssuesTest
  2. 7 phamlp/tests/tests_issues.php \IssuesTest
  3. 7 phamlp/tests/tests_ifs.php \IssuesTest
  4. 7 phamlp/tests/tests_extend.php \IssuesTest
  5. 7 phamlp/tests/tests_variables.php \IssuesTest
  6. 7 phamlp/tests/tests_interpolator.php \IssuesTest
Same name and namespace in other branches
  1. 7.3 phpsass/tests/tests_compass.php \IssuesTest
  2. 7.3 phpsass/tests/tests_issues.php \IssuesTest
  3. 7.3 phpsass/tests/tests_ifs.php \IssuesTest
  4. 7.3 phpsass/tests/tests_extend.php \IssuesTest
  5. 7.3 phpsass/tests/tests_variables.php \IssuesTest
  6. 7.3 phpsass/tests/tests_interpolator.php \IssuesTest

Hierarchy

Expanded class hierarchy of IssuesTest

File

phamlp/tests/tests_issues.php, line 5

View source
class IssuesTest extends ScssUnitTest {
  public function test_lighten_darken() {
    $tests = array(
      '{ color: lighten(#B8860B, 3%); }' => 'color: #c6910c;',
      '{ color: darken(#b8860b, 3%); }' => 'color: #aa7b0a;',
      '{ color: lighten(#99FF99, 8%); }' => 'color: #c2ffc2;',
      '{ color: darken(#99FF99, 8%); }' => 'color: #70ff70;',
      '{ color: lighten(#A4D9E4, 6%); }' => 'color: #bce3eb;',
      '{ color: darken(#A4D9E4, 6%); }' => 'color: #8ccfdd;',
      '{ color: lighten(#806918, 26%); }' => 'color: #dbb941;',
      '{ color: darken(#806918, 8%); }' => 'color: #5e4d12;',
    );
    $this
      ->assertScss(array_keys($tests), array_values($tests));
  }
  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);
  }

}

Members