-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathSyncPackagesCommandTest.php
More file actions
96 lines (84 loc) · 2.39 KB
/
SyncPackagesCommandTest.php
File metadata and controls
96 lines (84 loc) · 2.39 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
declare(strict_types=1);
namespace App\Test\TestCase\Command;
use App\Command\SyncPackagesCommand;
use Cake\Console\TestSuite\ConsoleIntegrationTestTrait;
use Cake\I18n\Date;
use Cake\TestSuite\TestCase;
use Packagist\Api\Result\Package\Version;
use ReflectionMethod;
/**
* App\Command\SyncPackagesCommand Test Case
*
* @link \App\Command\SyncPackagesCommand
*/
class SyncPackagesCommandTest extends TestCase
{
use ConsoleIntegrationTestTrait;
/**
* @return void
*/
public function testHasExplicitCakePhpDependency(): void
{
$command = new SyncPackagesCommand();
$method = new ReflectionMethod($command, 'hasExplicitCakePhpDependency');
$method->setAccessible(true);
$this->assertTrue($method->invoke($command, ['PHP: 8.2', 'CakePHP: 5.0']));
$this->assertFalse($method->invoke($command, ['PHP: 8.2']));
}
/**
* @return void
*/
public function testExtractReleaseDate(): void
{
$command = new SyncPackagesCommand();
$method = new ReflectionMethod($command, 'extractReleaseDate');
$method->setAccessible(true);
$version = new Version();
$version->fromArray([
'time' => '2026-04-05T11:22:33+00:00',
]);
$this->assertEquals(new Date('2026-04-05'), $method->invoke($command, $version));
$this->assertNull($method->invoke($command, null));
}
/**
* Test defaultName method
*
* @return void
* @link \App\Command\SyncPackagesCommand::defaultName()
*/
public function testDefaultName(): void
{
$this->markTestIncomplete('Not implemented yet.');
}
/**
* Test getDescription method
*
* @return void
* @link \App\Command\SyncPackagesCommand::getDescription()
*/
public function testGetDescription(): void
{
$this->markTestIncomplete('Not implemented yet.');
}
/**
* Test buildOptionParser method
*
* @return void
* @link \App\Command\SyncPackagesCommand::buildOptionParser()
*/
public function testBuildOptionParser(): void
{
$this->markTestIncomplete('Not implemented yet.');
}
/**
* Test execute method
*
* @return void
* @link \App\Command\SyncPackagesCommand::execute()
*/
public function testExecute(): void
{
$this->markTestIncomplete('Not implemented yet.');
}
}