From a02096c5b9dafddc3353e8c5eff060fcb004985f Mon Sep 17 00:00:00 2001 From: Nay Lin Aung Date: Tue, 19 Mar 2019 13:06:25 +0630 Subject: [PATCH] Add Message Account Linking event to Facebook Driver (#92) * Add Message Account Linking event to Facebook Driver * Apply fixes from StyleCI * [update] fix class naming * add Messaging Account Linking Event Test Case * Apply fixes from StyleCI --- src/Events/MessagingAccountLinking.php | 16 ++++++++++++++++ src/FacebookDriver.php | 3 +++ tests/FacebookDriverTest.php | 12 ++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 src/Events/MessagingAccountLinking.php diff --git a/src/Events/MessagingAccountLinking.php b/src/Events/MessagingAccountLinking.php new file mode 100644 index 0000000..4550968 --- /dev/null +++ b/src/Events/MessagingAccountLinking.php @@ -0,0 +1,16 @@ +assertSame('messaging_reads', $event->getName()); } + /** @test */ + public function it_calls_account_linking_event() + { + $request = '{"object":"page","entry":[{"id":"111899832631525","time":1480279487271,"messaging":[{"sender":{"id":"USER_ID"},"recipient":{"id":"PAGE_ID"},"timestamp":1458668856463,"account_linking":{"status":"linked","authorization_code":"authorization code"}}]}]}'; + $driver = $this->getDriver($request); + + $event = $driver->hasMatchingEvent(); + $this->assertInstanceOf(MessagingAccountLinking::class, $event); + $this->assertSame('messaging_account_linking', $event->getName()); + } + /** @test */ public function it_calls_checkout_update_event() {