-
-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathPackageTest.php
More file actions
executable file
·68 lines (60 loc) · 1.41 KB
/
PackageTest.php
File metadata and controls
executable file
·68 lines (60 loc) · 1.41 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
/**
* @copyright Copyright (C) 2005 - 2022 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\Github\Tests;
use Joomla\Github\Github;
use Joomla\Github\Tests\Stub\GitHubTestCase;
/**
* Test class for Joomla\Github\Github.
*
* @since 1.0
*/
class PackageTest extends GitHubTestCase
{
/**
* @var Github Object under test.
* @since 1.0
*/
protected $object;
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
*
* @since 1.0
*/
protected function setUp(): void
{
parent::setUp();
$this->object = new Github($this->options, $this->client);
}
/**
* Tests the magic __get method
*
* @return void
*
* @since 1.0
*/
public function testGet()
{
$this->assertThat(
$this->object->repositories->forks,
$this->isInstanceOf('Joomla\Github\Package\Repositories\Forks')
);
}
/**
* Tests the magic __get method with an invalid parameter.
*
* @return void
*
* @since 1.0
*/
public function testGetInvalid()
{
$this->expectException(\InvalidArgumentException::class);
$this->object->repositories->INVALID;
}
}