msg->thenReturn(""); } public function tearDown(): void { // verify calls to the mock Lang object \Phake::verify(Arsse::$lang, \Phake::atLeast(0))->msg($this->isType("string"), $this->anything()); \Phake::verifyNoOtherInteractions(Arsse::$lang); // clean up self::clearData(true); } public function testBaseClass(): void { $this->assertException("unknown"); throw new Exception("unknown"); } /** * @depends testBaseClass */ public function testBaseClassWithoutMessage(): void { $this->assertException("unknown"); throw new Exception(); } /** * @depends testBaseClass */ public function testDerivedClass(): void { $this->assertException("fileMissing", "Lang"); throw new LangException("fileMissing"); } /** * @depends testDerivedClass */ public function testDerivedClassWithMessageParameters(): void { $this->assertException("fileMissing", "Lang"); throw new LangException("fileMissing", "en"); } /** * @depends testBaseClass */ public function testBaseClassWithUnknownCode(): void { $this->assertException("uncoded"); throw new Exception("testThisExceptionMessageDoesNotExist"); } /** * @depends testBaseClassWithUnknownCode */ public function testDerivedClassWithMissingMessage(): void { $this->assertException("uncoded"); throw new LangException("testThisExceptionMessageDoesNotExist"); } /** @covers \JKingWeb\Arsse\ExceptionFatal */ public function testFatalException(): void { $this->expectException('JKingWeb\Arsse\ExceptionFatal'); throw new \JKingWeb\Arsse\ExceptionFatal(""); } public function testGetExceptionSymbol(): void { $e = new LangException("stringMissing", ['msgID' => "OOK"]); $this->assertSame("stringMissing", $e->getSymbol()); } public function testGetExceptionParams(): void { $e = new LangException("stringMissing", ['msgID' => "OOK"]); $this->assertSame(['msgID' => "OOK"], $e->getParams()); } }