minor #38234 [Intl] fix test by letting mock throw the actual expected exception (xabbuh)

This PR was merged into the 3.4 branch.

Discussion
----------

[Intl] fix test by letting mock throw the actual expected exception

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #37808
| License       | MIT
| Doc PR        |

This fixes a mistake I made when rewriting the tests in #37808.

Commits
-------

f6f162dcdd fix test by letting mock throw the actual expected exception
This commit is contained in:
Christian Flothmann 2020-09-18 16:09:04 +02:00
commit 7fa12576ef
1 changed files with 5 additions and 2 deletions

View File

@ -144,7 +144,10 @@ class BundleEntryReaderTest extends TestCase
[self::RES_DIR, 'en_GB'],
[self::RES_DIR, 'en']
)
->willReturnOnConsecutiveCalls(self::$data, self::$fallbackData);
->willReturnOnConsecutiveCalls(
$this->throwException(new ResourceBundleNotFoundException()),
self::$fallbackData
);
$this->assertSame('Lah', $this->reader->readEntry(self::RES_DIR, 'en_GB', ['Entries', 'Bam']));
}
@ -283,7 +286,7 @@ class BundleEntryReaderTest extends TestCase
[self::RES_DIR, 'en_GB'],
[self::RES_DIR, 'en']
)
->willReturnOnConsecutiveCalls(['Foo' => 'Baz'], ['Foo' => 'Baz']);
->willReturnOnConsecutiveCalls(['Foo' => 'Baz'], ['Foo' => 'Bar']);
$this->reader->readEntry(self::RES_DIR, 'en_GB', ['Foo', 'Bar'], true);
}