Skip to content

EspoCRM – Open Source CRM Application

Test

Yuriied794c2c39f0
diff --git a/tests/integration/Espo/Core/EntryPoint/EntryPointTest.php b/tests/integration/Espo/Core/EntryPoint/EntryPointTest.php
index ea477fe4a8..5f3620e890 100644
--- a/tests/integration/Espo/Core/EntryPoint/EntryPointTest.php
+++ b/tests/integration/Espo/Core/EntryPoint/EntryPointTest.php
@@ -126,6 +126,51 @@ class EntryPointTest extends BaseTestCase
$this->assertFalse($applicationState->hasUser());
}
+ /**
+ * @noinspection PhpUnhandledExceptionInspection
+ */
+ public function testNotExposed(): void
+ {
+ $metadata = $this->getMetadata();
+ $metadata->set('app', 'entryPoints', [
+ 'oauthCallback' => [
+ 'notExposed' => true,
+ ],
+ ]);
+ $metadata->save();
+
+ $this->reCreateApplication(reuse: true, noUser: true);
+
+ $outputEmitter = $this->createMock(OutputEmitter::class);
+ $errorOutput = $this->createMock(ErrorOutput::class);
+
+ $request = $this->createRequest(
+ method: Method::GET,
+ queryParams: [
+ 'entryPoint' => 'oauthCallback',
+ ],
+ );
+
+ $response = $this->createMock(ResponseWrapper::class);
+
+ $starter = $this->createStarter(
+ request: $request,
+ response: $response,
+ outputEmitter: $outputEmitter,
+ errorOutput: $errorOutput,
+ );
+
+ $errorOutput
+ ->expects(self::once())
+ ->method('processWithBodyPrinting');
+
+ $starter->start();
+
+ $applicationState = $this->getContainer()->getByClass(ApplicationState::class);
+
+ $this->assertFalse($applicationState->hasUser());
+ }
+
/**
* @noinspection PhpUnhandledExceptionInspection
*/