• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

podio-community / podio-php / 5913127652

19 Aug 2023 07:20PM UTC coverage: 54.871% (+1.4%) from 53.497%
5913127652

Pull #242

github

daniel-sc
some more unit tests - primarily for coverage
Pull Request #242: More fixes

181 of 181 new or added lines in 43 files covered. (100.0%)

1149 of 2094 relevant lines covered (54.87%)

34.44 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

70.83
/models/PodioComment.php
1
<?php
2
/**
3
 * @see https://developers.podio.com/doc/comments
4
 */
5
class PodioComment extends PodioObject
6
{
7
    public function __construct($attributes = array())
8
    {
9
        parent::__construct();
4✔
10
        $this->property('comment_id', 'integer', array('id' => true));
4✔
11
        $this->property('value', 'string');
4✔
12
        $this->property('rich_value', 'string');
4✔
13
        $this->property('external_id', 'string');
4✔
14
        $this->property('space_id', 'integer');
4✔
15
        $this->property('created_on', 'datetime');
4✔
16
        $this->property('like_count', 'integer');
4✔
17
        $this->property('is_liked', 'boolean');
4✔
18

19
        $this->has_one('created_by', 'ByLine');
4✔
20
        $this->has_one('created_via', 'Via');
4✔
21
        $this->has_one('ref', 'Reference');
4✔
22

23
        $this->has_one('embed', 'Embed', array('json_value' => 'embed_id', 'json_target' => 'embed_id'));
4✔
24
        $this->has_one('embed_file', 'File', array('json_value' => 'file_id', 'json_target' => 'embed_file_id'));
4✔
25
        $this->has_many('files', 'File', array('json_value' => 'file_id', 'json_target' => 'file_ids'));
4✔
26
        $this->has_many('questions', 'Question');
4✔
27

28
        $this->init($attributes);
4✔
29
    }
30

31
    /**
32
     * @see https://developers.podio.com/doc/comments/get-a-comment-22345
33
     */
34
    public static function get(PodioClient $podio_client, $comment_id)
35
    {
36
        return self::member($podio_client->get("/comment/{$comment_id}"));
×
37
    }
38

39
    /**
40
     * @see https://developers.podio.com/doc/comments/get-comments-on-object-22371
41
     */
42
    public static function get_for(PodioClient $podio_client, $ref_type, $ref_id, $attributes = array())
43
    {
44
        return self::listing($podio_client->get("/comment/{$ref_type}/{$ref_id}/", $attributes));
×
45
    }
46

47
    /**
48
     * @see https://developers.podio.com/doc/comments/delete-a-comment-22347
49
     */
50
    public static function delete(PodioClient $podio_client, $comment_id)
51
    {
52
        return $podio_client->delete("/comment/{$comment_id}");
×
53
    }
54

55
    /**
56
     * @see https://developers.podio.com/doc/comments/add-comment-to-object-22340
57
     */
58
    public static function create(PodioClient $podio_client, $ref_type, $ref_id, $attributes = array(), $options = array())
59
    {
60
        $url = $podio_client->url_with_options("/comment/{$ref_type}/{$ref_id}", $options);
×
61
        $body = $podio_client->post($url, $attributes)->json_body();
×
62
        return $body['comment_id'];
×
63
    }
64

65
    /**
66
     * @see https://developers.podio.com/doc/comments/update-a-comment-22346
67
     */
68
    public static function update(PodioClient $podio_client, $comment_id, $attributes = array())
69
    {
70
        return $podio_client->put("/comment/{$comment_id}", $attributes);
×
71
    }
72
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc