From 43073bd22668a8c3a5a8db683215ed8612293d52 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Tue, 11 Jun 2019 14:16:32 -0600 Subject: [PATCH] Add AcceptVerbTest --- .../Unit/ActivityPub/Verb/AcceptVerbTest.php | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 tests/Unit/ActivityPub/Verb/AcceptVerbTest.php diff --git a/tests/Unit/ActivityPub/Verb/AcceptVerbTest.php b/tests/Unit/ActivityPub/Verb/AcceptVerbTest.php new file mode 100644 index 000000000..81f631df9 --- /dev/null +++ b/tests/Unit/ActivityPub/Verb/AcceptVerbTest.php @@ -0,0 +1,55 @@ +validAccept = [ + '@context' => 'https://www.w3.org/ns/activitystreams', + 'id' => 'https://example.org/og/b3e4a40b-0b26-4c5a-9079-094bd633fab7', + 'type' => 'Accept', + 'actor' => 'https://example.org/u/alice', + 'object' => [ + 'id' => 'https://example.net/u/bob#follows/bb27f601-ddb9-4567-8f16-023d90605ca9', + 'type' => 'Follow', + 'actor' => 'https://example.net/u/bob', + 'object' => 'https://example.org/u/alice' + ] + ]; + $this->invalidAccept = [ + '@context' => 'https://www.w3.org/ns/activitystreams', + 'id' => 'https://example.org/og/b3e4a40b-0b26-4c5a-9079-094bd633fab7', + 'type' => 'Accept2', + 'actor' => 'https://example.org/u/alice', + 'object' => [ + 'id' => 'https://example.net/u/bob#follows/bb27f601-ddb9-4567-8f16-023d90605ca9', + 'type' => 'Follow', + 'actor' => 'https://example.net/u/bob', + 'object' => 'https://example.org/u/alice' + ] + ]; + } + + /** @test */ + public function basic_accept() + { + $this->assertTrue(Accept::validate($this->validAccept)); + } + + /** @test */ + public function invalid_accept() + { + $this->assertFalse(Accept::validate($this->invalidAccept)); + } +}