Skip to content

Commit

Permalink
Fix tests for assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
kylekatarnls committed Oct 8, 2022
1 parent 27ccf46 commit 7533aaf
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 23 deletions.
41 changes: 32 additions & 9 deletions .multi-tester.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
pug-php/pug: default
pug-php/pug:
install:
- composer config --no-plugins allow-plugins.nodejs-php-fallback/nodejs-php-fallback true
- composer install --no-interaction

pug/bemto:
autoload:
Expand All @@ -8,11 +11,20 @@ pug/bemto:
- composer dump-autoload --optimize --no-interaction --quiet
- composer self-update --2

pug-php/pug-assets: default
pug-php/pug-assets:
install:
- composer config --no-plugins allow-plugins.nodejs-php-fallback/nodejs-php-fallback true
- composer install --no-interaction

pug-php/pug-minify: default
pug-php/pug-minify:
install:
- composer config --no-plugins allow-plugins.nodejs-php-fallback/nodejs-php-fallback true
- composer install --no-interaction

pug/slim: default
pug/slim:
install:
- composer config --no-plugins allow-plugins.nodejs-php-fallback/nodejs-php-fallback true
- composer install --no-interaction

pug/twig:
autoload:
Expand All @@ -21,8 +33,19 @@ pug/twig:
- composer dump-autoload --optimize --no-interaction --quiet
- composer self-update --2

ci-pug/ci-pug: default

bkwld/laravel-pug: default

pug/yii2: default
ci-pug/ci-pug:
install:
- composer config --no-plugins allow-plugins.nodejs-php-fallback/nodejs-php-fallback true
- composer install --no-interaction

bkwld/laravel-pug:
install:
- composer config --no-plugins allow-plugins.pug/installer true
- composer config --no-plugins allow-plugins.nodejs-php-fallback/nodejs-php-fallback true
- composer install --no-interaction

pug/yii2:
install:
- composer config --no-plugins allow-plugins.yiisoft/yii2-composer true
- composer config --no-plugins allow-plugins.nodejs-php-fallback/nodejs-php-fallback true
- composer install --no-interaction
2 changes: 1 addition & 1 deletion tests/Phug/Lexer/Scanner/AssignmentScannerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function testObjectInTernary()

self::assertSame(
'isNestedFile ? {\'href\': \'../account-orders.html\'} : {\'href\': \'accountorders.html\'}',
$tok->getName()
$tok->getValue()
);
}
}
26 changes: 13 additions & 13 deletions tests/Phug/Lexer/Scanner/AttributeScannerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -603,21 +603,21 @@ public function testJsAttributeStyle()
self::assertSame('"a"', $class->getValue());
}

/**
* @covers \Phug\Lexer\Scanner\AssignmentScanner::scan
*/
public function testTernaryRendering()
{
list(
$tag,
$assignment,
$start,
$attribute,
$end,
) = $this->assertTokens('div&attributes(val === "42" ? {"answer": "42"} : {"ko": "failed"})', [
TagToken::class,
AssignmentToken::class,
AttributeStartToken::class,
AttributeToken::class,
AttributeEndToken::class,
]);
list($tag, $assignment, $start, $attribute, $end) = $this->assertTokens(
'div&attributes(val === "42" ? {"answer": "42"} : {"ko": "failed"})',
[
TagToken::class,
AssignmentToken::class,
AttributeStartToken::class,
AttributeToken::class,
AttributeEndToken::class,
]
);

self::assertSame('div', $tag->getName());
self::assertSame('attributes', $assignment->getName());
Expand Down

0 comments on commit 7533aaf

Please sign in to comment.