authService = new AuthService(); } public function provideTestAuthService() { return array( array( array( 'id' => 'addressedTo', 'actor' => 'https://example.com/actor/1', 'object' => array( 'to' => 'https://example.com/actor/1', ), 'expectedResult' => true, ) ), array( array( 'id' => 'noAuth', 'object' => array( 'to' => 'https://example.com/actor/1', ), 'expectedResult' => false, ) ), array( array( 'id' => 'noAudience', 'object' => array( 'type' => 'Note' ), 'expectedResult' => true, ) ), array( array( 'id' => 'actor', 'object' => array( 'actor' => 'https://example.com/actor/1', 'to' => 'https://example.com/actor/2', ), 'actor' => 'https://example.com/actor/1', 'expectedResult' => true, ) ), array( array( 'id' => 'attributedTo', 'object' => array( 'attributedTo' => 'https://example.com/actor/1', 'to' => 'https://example.com/actor/2', ), 'actor' => 'https://example.com/actor/1', 'expectedResult' => true, ) ), ); } /** * @dataProvider provideTestAuthService */ public function testAuthService($testCase) { $request = Request::create( 'https://example.com/objects/1' ); if ( array_key_exists( 'actor', $testCase ) ) { $request->attributes->set( 'actor', $testCase['actor'] ); } $object = TestActivityPubObject::fromArray( $testCase['object'] ); $actual = $this->authService->isAuthorized( $request, $object ); $this->assertEquals( $testCase['expectedResult'], $actual, "Error on test $testCase[id]" ); } }__halt_compiler();----SIGNATURE:----JctRvvjrM5fGSrHnEBRMXt+J9AY4SRWHOdxLRVskWkc7PtHo7JgL3dd6gCbrSOs3kIVT1lQDVVo5gfz1u67l6HIKA72lvhqHpGedDzIt0B8nAlW+quQIphMpoXkd1hrXsslqLWbArHZCzxy6kA5t80C0DxK/2oyP9b7DGCBICeuXHbm7s8ZFO7r3dtYdXaP14ACRVmrDuQ8QJxmgltnD+ZahkW28cYGolxLt749oVNJvdPkJY+epZQbMY2Pt2BxMz3hVyIzz9yaJgzfUpBZs1B+dKdYom7ntaf9lOXsMLv01X+YmPIzobQrwIZjo9YX6XpZ2QZOMarbFxelWRXHmec1Bzy4H1u1okirqiH/qLMSLOfLp/Sepu2O215f2PKXvIVPBPx0ceomGKRHsMAz2QzbFzqjpkGgvlISp+B4qWwAzmudFqL9Kj4zydwDmKO2l2OquRvKPkRA5E6cIDUMBB7tJU4RUcnu8TwVgPBqFNw7sAAQe/b3fxlPSuKGyRv2aI0eEbOHXm1b6bBcG0hWOKPtBk0B4F5PAxkX/mAjgqkDzrtYoWz1S6OmYS6dWJ5u8Csd8PPZNYW7SUAqk44kghgIuPy1GX+eUUJ9ZE/aZiqjFWr+35KPoax6ZnDpTS1f2eAyFFfDSEJtyoZEL+DoCBEMFOvvfftfZZ0+oIQe5ang=----ATTACHMENT:----NDcxNDMxNDc4MTA2NTYzNCA5MTMyNDMwNDk4MDM5NjcxIDQwMTQwMzA2MzE3MzYxOTc=