summaryrefslogtreecommitdiff
path: root/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/test/integration/Categories/CategoriesTest.php
blob: 33442f4bda28dfae08ea95bf466f33b0dad7c10e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php

namespace SendGrid\Tests\Categories;

use SendGrid\Tests\BaseTestClass;

class CategoriesTest extends BaseTestClass
{
    public function testCategoriesGetMethod()
    {
        $query_params = json_decode('{"category": "test_string", "limit": 1, "offset": 1}');
        $request_headers = ["X-Mock: 200"];
        $response = self::$sg->client->categories()->get(null, $query_params, $request_headers);
        $this->assertEquals(200, $response->statusCode());
    }

    public function testCategoriesStatsGetMethod()
    {
        $query_params = json_decode('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "offset": 1, "start_date": "2016-01-01", "categories": "test_string"}');
        $request_headers = ["X-Mock: 200"];
        $response = self::$sg->client->categories()->stats()->get(null, $query_params, $request_headers);
        $this->assertEquals(200, $response->statusCode());
    }

    public function testCategoriesStatsSumsGetMethod()
    {
        $query_params = json_decode('{"end_date": "2016-04-01", "aggregated_by": "day", "limit": 1, "sort_by_metric": "test_string", "offset": 1, "start_date": "2016-01-01", "sort_by_direction": "asc"}');
        $request_headers = ["X-Mock: 200"];
        $response = self::$sg->client->categories()->stats()->sums()->get(null, $query_params, $request_headers);
        $this->assertEquals(200, $response->statusCode());
    }
}