File: a.php

package info (click to toggle)
php-nunomaduro-termwind 2.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,172 kB
  • sloc: php: 3,969; makefile: 34
file content (31 lines) | stat: -rw-r--r-- 783 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php

use function Termwind\parse;

it('renders the element', function () {
    $html = parse('<a>link text</a>');

    expect($html)->toBe('link text');
});

it('renders the href property', function () {
    $html = parse('<a href="url">link text</a>');

    expect($html)->toBe('<href=url>link text</>');
});

it('renders the href with %', function () {
    $html = parse('<a href="someurlwith%s">link text</a>');

    expect($html)->toBe('<href=someurlwith%s>link text</>');
});

it('renders an element with width', function () {
    $html = parse(<<<'HTML'
        <div class="w-10">
            <a href="https://github.com/nunomaduro/termwind">click here</a>
        </div>
    HTML);

    expect($html)->toBe('<href=https://github.com/nunomaduro/termwind>click here</>');
});