Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Kühne <[email protected]>
  • Loading branch information
MatthiasKuehneEllerhold committed Dec 6, 2023
1 parent 4fee064 commit 56bf60e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/View/Helper/CurrencyFormatTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,16 @@ public static function assertMbStringEquals(string $expected, string $test, stri
$test = str_replace(["\xC2\xA0", ' '], '', $test);
self::assertEquals($expected, $test, $message);
}

public function testNoImplicitLocale(): void
{
\Locale::setDefault('de');

Check failure on line 114 in test/View/Helper/CurrencyFormatTest.php

View workflow job for this annotation

GitHub Actions / ci / QA Checks (PHPCodeSniffer [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integration-ac...

Class \Locale should not be referenced via a fully qualified name, but via a use statement.

Check failure on line 114 in test/View/Helper/CurrencyFormatTest.php

View workflow job for this annotation

GitHub Actions / ci / QA Checks (PHPCodeSniffer [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integration-ac...

Expected class name Locale; found \Locale
self::assertEquals(Locale::getDefault(), $this->helper->getLocale());

\Locale::setDefault('en');

Check failure on line 117 in test/View/Helper/CurrencyFormatTest.php

View workflow job for this annotation

GitHub Actions / ci / QA Checks (PHPCodeSniffer [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integration-ac...

Class \Locale should not be referenced via a fully qualified name, but via a use statement.

Check failure on line 117 in test/View/Helper/CurrencyFormatTest.php

View workflow job for this annotation

GitHub Actions / ci / QA Checks (PHPCodeSniffer [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integration-ac...

Expected class name Locale; found \Locale
self::assertEquals(Locale::getDefault(), $this->helper->getLocale());

$this->helper->setLocale('es');
self::assertEquals('es', $this->helper->getLocale());
}
}
12 changes: 12 additions & 0 deletions test/View/Helper/DateFormatTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,4 +292,16 @@ public function testIntlCalendarIsHandledAsWell(): void
$helper->__invoke($calendar, IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'it_IT', 'dd-MM-Y')
);
}

public function testNoImplicitLocale(): void
{
\Locale::setDefault('de');

Check failure on line 298 in test/View/Helper/DateFormatTest.php

View workflow job for this annotation

GitHub Actions / ci / QA Checks (PHPCodeSniffer [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integration-ac...

Class \Locale should not be referenced via a fully qualified name, but via a use statement.

Check failure on line 298 in test/View/Helper/DateFormatTest.php

View workflow job for this annotation

GitHub Actions / ci / QA Checks (PHPCodeSniffer [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integration-ac...

Expected class name Locale; found \Locale
self::assertEquals(Locale::getDefault(), $this->helper->getLocale());

\Locale::setDefault('en');
self::assertEquals(Locale::getDefault(), $this->helper->getLocale());

$this->helper->setLocale('es');
self::assertEquals('es', $this->helper->getLocale());
}
}
12 changes: 12 additions & 0 deletions test/View/Helper/NumberFormatTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,16 @@ public static function assertMbStringEquals(string $expected, string $test, stri
$test = str_replace(["\xC2\xA0", ' '], '', $test);
self::assertEquals($expected, $test, $message);
}

public function testNoImplicitLocale(): void
{
\Locale::setDefault('de');

Check failure on line 202 in test/View/Helper/NumberFormatTest.php

View workflow job for this annotation

GitHub Actions / ci / QA Checks (PHPCodeSniffer [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integration-ac...

Class \Locale should not be referenced via a fully qualified name, but via a use statement.

Check failure on line 202 in test/View/Helper/NumberFormatTest.php

View workflow job for this annotation

GitHub Actions / ci / QA Checks (PHPCodeSniffer [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integration-ac...

Expected class name Locale; found \Locale
self::assertEquals(Locale::getDefault(), $this->helper->getLocale());

\Locale::setDefault('en');

Check failure on line 205 in test/View/Helper/NumberFormatTest.php

View workflow job for this annotation

GitHub Actions / ci / QA Checks (PHPCodeSniffer [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integration-ac...

Class \Locale should not be referenced via a fully qualified name, but via a use statement.

Check failure on line 205 in test/View/Helper/NumberFormatTest.php

View workflow job for this annotation

GitHub Actions / ci / QA Checks (PHPCodeSniffer [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integration-ac...

Expected class name Locale; found \Locale
self::assertEquals(Locale::getDefault(), $this->helper->getLocale());

$this->helper->setLocale('es');
self::assertEquals('es', $this->helper->getLocale());
}
}

0 comments on commit 56bf60e

Please sign in to comment.