public function testNotifySeveralActionsWithCategories()
 {
     $history = new History();
     $this->client->getEmitter()->attach($history);
     $this->subscriber->addResponse(new Response(200, [], new Stream(fopen('data://text/plain,[]', 'r'))));
     $item = new Item();
     $item->setItemId('the-item');
     $actionLogin = new Action();
     $actionLogin->setActionCode('LOGIN')->setItem($item);
     $actionSignup = new Action();
     $actionSignup->setActionCode('SIGNUP')->setCategories(['foo', 'bar']);
     $this->client->notifySeveralActions('12345', [$actionLogin, $actionSignup]);
     $contents = $history->getLastRequest()->getBody()->__toString();
     $request = json_decode($contents, true);
     $this->assertEquals(['userId' => '12345', 'actions' => [['actionCode' => 'LOGIN', 'item' => ['id' => 'the-item', 'title' => null, 'description' => null, 'author' => null]], ['actionCode' => 'SIGNUP', 'categories' => ['foo', 'bar']]]], $request);
 }