đļī¸ Naming Assertions â
toHavePrefix() â
php
$this
->allClasses()
->fromRaw('<?php class ExempleFoo {}')
->should(fn(Expr $expr) => $expr->toHavePrefix('Exemple'));toNotHavePrefix() â
Opposite of toHavePrefix(). Fails if the short class name starts with the given prefix; anonymous classes always pass.
php
$this
->allClasses()
->fromDir('src')
->should(fn(Expr $expr) => $expr->toNotHavePrefix('Abstract'));toHaveSuffix() â
php
$this
->allClasses()
->fromRaw('<?php class FooExemple {}')
->should(fn(Expr $expr) => $expr->toHaveSuffix('Exemple'));toNotHaveSuffix() â
Opposite of toHaveSuffix(). Fails if the short class name ends with the given suffix; anonymous classes always pass.
php
$this
->allClasses()
->fromDir('src/Contracts')
->should(fn(Expr $expr) => $expr->toNotHaveSuffix('Interface'));