Completed
Push — master ( b77f02...053cae )
by Alessandro
01:47 queued 23s
created

BitlyTest::testIsThereAnySyntaxError()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
use PHPUnit\Framework\TestCase;
3
4
//require_once '../api.php'; < TO LOCAL TEST
5
define("TOKEN","123456789");
6
/**
7
 *
8
 *  @author sineverba
9
 */
10
class BitlyTest extends TestCase
11
{
12
13
    /**
14
     * Just check if Bitly has no syntax error
15
     *
16
     * This is just a simple check to make sure your library has no syntax error. This helps you troubleshoot
17
     * any typo before you even use this library in a real project.
18
     *
19
     */
20
    public function testIsThereAnySyntaxError()
21
    {
22
        $bitly = new sineverba\Bitly\Bitly(TOKEN);
23
        $this->assertTrue(is_object($bitly));
24
        unset($bitly);
25
    }
26
27
28
    /**
29
     * Test if Bitly return a short link
30
     */
31
    public function testIfReturnsAShortLink()
32
    {
33
        $bitly = new sineverba\Bitly\Bitly(TOKEN);
34
        $bitly->createShortLink("http://www.google.it");
35
        $this->assertNotNull($bitly->getShortUrl());
36
        unset($bitly);
37
    }
38
39
}
40