| 1 |
<?php |
| 2 |
|
| 3 |
namespace Wikimedia\Tests\Composer; |
| 4 |
|
| 5 |
use PHPUnit\Framework\TestCase; |
| 6 |
use Wikimedia\Composer\ComposerInstalled; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
class ComposerInstalledTest extends TestCase { |
| 12 |
|
| 13 |
public function testGetInstalledDependencies() { |
| 14 |
$location = __DIR__ . '/../../../../data/composer/installed-v2.json'; |
| 15 |
$installed = new ComposerInstalled( $location ); |
| 16 |
$this->assertEquals( [ |
| 17 |
'leafo/lessphp' => [ |
| 18 |
'version' => '0.5.0', |
| 19 |
'type' => 'library', |
| 20 |
'licenses' => [ 'MIT', 'GPL-3.0-only' ], |
| 21 |
'authors' => [ |
| 22 |
[ |
| 23 |
'name' => 'Leaf Corcoran', |
| 24 |
'email' => '[email protected]', |
| 25 |
'homepage' => 'http://leafo.net', |
| 26 |
], |
| 27 |
], |
| 28 |
'description' => 'lessphp is a compiler for LESS written in PHP.', |
| 29 |
], |
| 30 |
'psr/log' => [ |
| 31 |
'version' => '1.0.0', |
| 32 |
'type' => 'library', |
| 33 |
'licenses' => [ 'MIT' ], |
| 34 |
'authors' => [ |
| 35 |
[ |
| 36 |
'name' => 'PHP-FIG', |
| 37 |
'homepage' => 'http://www.php-fig.org/', |
| 38 |
], |
| 39 |
], |
| 40 |
'description' => 'Common interface for logging libraries', |
| 41 |
], |
| 42 |
'cssjanus/cssjanus' => [ |
| 43 |
'version' => '1.1.1', |
| 44 |
'type' => 'library', |
| 45 |
'licenses' => [ 'Apache-2.0' ], |
| 46 |
'authors' => [ |
| 47 |
], |
| 48 |
'description' => 'Convert CSS stylesheets between left-to-right ' . |
| 49 |
'and right-to-left.', |
| 50 |
], |
| 51 |
'cdb/cdb' => [ |
| 52 |
'version' => '1.0.0', |
| 53 |
'type' => 'library', |
| 54 |
'licenses' => [ 'GPLv2' ], |
| 55 |
'authors' => [ |
| 56 |
[ |
| 57 |
'name' => 'Tim Starling', |
| 58 |
'email' => '[email protected]', |
| 59 |
], |
| 60 |
[ |
| 61 |
'name' => 'Chad Horohoe', |
| 62 |
'email' => '[email protected]', |
| 63 |
], |
| 64 |
], |
| 65 |
'description' => 'Constant Database (CDB) wrapper library for PHP. ' . |
| 66 |
'Provides pure-PHP fallback when dba_* functions are absent.', |
| 67 |
], |
| 68 |
'sebastian/version' => [ |
| 69 |
'version' => '2.0.1', |
| 70 |
'type' => 'library', |
| 71 |
'licenses' => [ 'BSD-3-Clause' ], |
| 72 |
'authors' => [ |
| 73 |
[ |
| 74 |
'name' => 'Sebastian Bergmann', |
| 75 |
'email' => '[email protected]', |
| 76 |
'role' => 'lead', |
| 77 |
], |
| 78 |
], |
| 79 |
'description' => 'Library that helps with managing the version ' . |
| 80 |
'number of Git-hosted PHP projects', |
| 81 |
], |
| 82 |
'sebastian/resource-operations' => [ |
| 83 |
'version' => '1.0.0', |
| 84 |
'type' => 'library', |
| 85 |
'licenses' => [ 'BSD-3-Clause' ], |
| 86 |
'authors' => [ |
| 87 |
[ |
| 88 |
'name' => 'Sebastian Bergmann', |
| 89 |
'email' => '[email protected]', |
| 90 |
], |
| 91 |
], |
| 92 |
'description' => 'Provides a list of PHP built-in functions that ' . |
| 93 |
'operate on resources', |
| 94 |
], |
| 95 |
'sebastian/recursion-context' => [ |
| 96 |
'version' => '3.0.0', |
| 97 |
'type' => 'library', |
| 98 |
'licenses' => [ 'BSD-3-Clause' ], |
| 99 |
'authors' => [ |
| 100 |
[ |
| 101 |
'name' => 'Jeff Welch', |
| 102 |
'email' => '[email protected]', |
| 103 |
], |
| 104 |
[ |
| 105 |
'name' => 'Sebastian Bergmann', |
| 106 |
'email' => '[email protected]', |
| 107 |
], |
| 108 |
[ |
| 109 |
'name' => 'Adam Harvey', |
| 110 |
'email' => '[email protected]', |
| 111 |
], |
| 112 |
], |
| 113 |
'description' => 'Provides functionality to recursively process PHP ' . |
| 114 |
'variables', |
| 115 |
], |
| 116 |
'sebastian/object-reflector' => [ |
| 117 |
'version' => '1.1.1', |
| 118 |
'type' => 'library', |
| 119 |
'licenses' => [ 'BSD-3-Clause' ], |
| 120 |
'authors' => [ |
| 121 |
[ |
| 122 |
'name' => 'Sebastian Bergmann', |
| 123 |
'email' => '[email protected]', |
| 124 |
], |
| 125 |
], |
| 126 |
'description' => 'Allows reflection of object attributes, including ' . |
| 127 |
'inherited and non-public ones', |
| 128 |
], |
| 129 |
'sebastian/object-enumerator' => [ |
| 130 |
'version' => '3.0.3', |
| 131 |
'type' => 'library', |
| 132 |
'licenses' => [ 'BSD-3-Clause' ], |
| 133 |
'authors' => [ |
| 134 |
[ |
| 135 |
'name' => 'Sebastian Bergmann', |
| 136 |
'email' => '[email protected]', |
| 137 |
], |
| 138 |
], |
| 139 |
'description' => 'Traverses array structures and object graphs ' . |
| 140 |
'to enumerate all referenced objects', |
| 141 |
], |
| 142 |
'sebastian/global-state' => [ |
| 143 |
'version' => '2.0.0', |
| 144 |
'type' => 'library', |
| 145 |
'licenses' => [ 'BSD-3-Clause' ], |
| 146 |
'authors' => [ |
| 147 |
[ |
| 148 |
'name' => 'Sebastian Bergmann', |
| 149 |
'email' => '[email protected]', |
| 150 |
], |
| 151 |
], |
| 152 |
'description' => 'Snapshotting of global state', |
| 153 |
], |
| 154 |
'sebastian/exporter' => [ |
| 155 |
'version' => '3.1.0', |
| 156 |
'type' => 'library', |
| 157 |
'licenses' => [ 'BSD-3-Clause' ], |
| 158 |
'authors' => [ |
| 159 |
[ |
| 160 |
'name' => 'Jeff Welch', |
| 161 |
'email' => '[email protected]', |
| 162 |
], |
| 163 |
[ |
| 164 |
'name' => 'Volker Dusch', |
| 165 |
'email' => '[email protected]', |
| 166 |
], |
| 167 |
[ |
| 168 |
'name' => 'Bernhard Schussek', |
| 169 |
'email' => '[email protected]', |
| 170 |
], |
| 171 |
[ |
| 172 |
'name' => 'Sebastian Bergmann', |
| 173 |
'email' => '[email protected]', |
| 174 |
], |
| 175 |
[ |
| 176 |
'name' => 'Adam Harvey', |
| 177 |
'email' => '[email protected]', |
| 178 |
], |
| 179 |
], |
| 180 |
'description' => 'Provides the functionality to export PHP ' . |
| 181 |
'variables for visualization', |
| 182 |
], |
| 183 |
'sebastian/environment' => [ |
| 184 |
'version' => '3.1.0', |
| 185 |
'type' => 'library', |
| 186 |
'licenses' => [ 'BSD-3-Clause' ], |
| 187 |
'authors' => [ |
| 188 |
[ |
| 189 |
'name' => 'Sebastian Bergmann', |
| 190 |
'email' => '[email protected]', |
| 191 |
], |
| 192 |
], |
| 193 |
'description' => 'Provides functionality to handle PHP ' . |
| 194 |
'environments', |
| 195 |
], |
| 196 |
'sebastian/diff' => [ |
| 197 |
'version' => '2.0.1', |
| 198 |
'type' => 'library', |
| 199 |
'licenses' => [ 'BSD-3-Clause' ], |
| 200 |
'authors' => [ |
| 201 |
[ |
| 202 |
'name' => 'Kore Nordmann', |
| 203 |
'email' => '[email protected]', |
| 204 |
], |
| 205 |
[ |
| 206 |
'name' => 'Sebastian Bergmann', |
| 207 |
'email' => '[email protected]', |
| 208 |
], |
| 209 |
], |
| 210 |
'description' => 'Diff implementation', |
| 211 |
], |
| 212 |
'sebastian/comparator' => [ |
| 213 |
'version' => '2.1.1', |
| 214 |
'type' => 'library', |
| 215 |
'licenses' => [ 'BSD-3-Clause' ], |
| 216 |
'authors' => [ |
| 217 |
[ |
| 218 |
'name' => 'Jeff Welch', |
| 219 |
'email' => '[email protected]', |
| 220 |
], |
| 221 |
[ |
| 222 |
'name' => 'Volker Dusch', |
| 223 |
'email' => '[email protected]', |
| 224 |
], |
| 225 |
[ |
| 226 |
'name' => 'Bernhard Schussek', |
| 227 |
'email' => '[email protected]', |
| 228 |
], |
| 229 |
[ |
| 230 |
'name' => 'Sebastian Bergmann', |
| 231 |
'email' => '[email protected]', |
| 232 |
], |
| 233 |
], |
| 234 |
'description' => 'Provides the functionality to compare PHP ' . |
| 235 |
'values for equality', |
| 236 |
], |
| 237 |
'doctrine/instantiator' => [ |
| 238 |
'version' => '1.1.0', |
| 239 |
'type' => 'library', |
| 240 |
'licenses' => [ 'MIT' ], |
| 241 |
'authors' => [ |
| 242 |
[ |
| 243 |
'name' => 'Marco Pivetta', |
| 244 |
'email' => '[email protected]', |
| 245 |
'homepage' => 'http://ocramius.github.com/', |
| 246 |
], |
| 247 |
], |
| 248 |
'description' => 'A small, lightweight utility to instantiate ' . |
| 249 |
'objects in PHP without invoking their constructors', |
| 250 |
], |
| 251 |
'phpunit/php-text-template' => [ |
| 252 |
'version' => '1.2.1', |
| 253 |
'type' => 'library', |
| 254 |
'licenses' => [ 'BSD-3-Clause' ], |
| 255 |
'authors' => [ |
| 256 |
[ |
| 257 |
'name' => 'Sebastian Bergmann', |
| 258 |
'email' => '[email protected]', |
| 259 |
'role' => 'lead', |
| 260 |
], |
| 261 |
], |
| 262 |
'description' => 'Simple template engine.', |
| 263 |
], |
| 264 |
'phpunit/php-timer' => [ |
| 265 |
'version' => '1.0.9', |
| 266 |
'type' => 'library', |
| 267 |
'licenses' => [ 'BSD-3-Clause' ], |
| 268 |
'authors' => [ |
| 269 |
[ |
| 270 |
'name' => 'Sebastian Bergmann', |
| 271 |
'email' => '[email protected]', |
| 272 |
'role' => 'lead', |
| 273 |
], |
| 274 |
], |
| 275 |
'description' => 'Utility class for timing', |
| 276 |
], |
| 277 |
'phpunit/php-file-iterator' => [ |
| 278 |
'version' => '1.4.5', |
| 279 |
'type' => 'library', |
| 280 |
'licenses' => [ 'BSD-3-Clause' ], |
| 281 |
'authors' => [ |
| 282 |
[ |
| 283 |
'name' => 'Sebastian Bergmann', |
| 284 |
'email' => '[email protected]', |
| 285 |
'role' => 'lead', |
| 286 |
], |
| 287 |
], |
| 288 |
'description' => 'FilterIterator implementation that filters ' . |
| 289 |
'files based on a list of suffixes.', |
| 290 |
], |
| 291 |
'theseer/tokenizer' => [ |
| 292 |
'version' => '1.1.0', |
| 293 |
'type' => 'library', |
| 294 |
'licenses' => [ 'BSD-3-Clause' ], |
| 295 |
'authors' => [ |
| 296 |
[ |
| 297 |
'name' => 'Arne Blankerts', |
| 298 |
'email' => '[email protected]', |
| 299 |
'role' => 'Developer', |
| 300 |
], |
| 301 |
], |
| 302 |
'description' => 'A small library for converting tokenized PHP ' . |
| 303 |
'source code into XML and potentially other formats', |
| 304 |
], |
| 305 |
'sebastian/code-unit-reverse-lookup' => [ |
| 306 |
'version' => '1.0.1', |
| 307 |
'type' => 'library', |
| 308 |
'licenses' => [ 'BSD-3-Clause' ], |
| 309 |
'authors' => [ |
| 310 |
[ |
| 311 |
'name' => 'Sebastian Bergmann', |
| 312 |
'email' => '[email protected]', |
| 313 |
], |
| 314 |
], |
| 315 |
'description' => 'Looks up which function or method a line of ' . |
| 316 |
'code belongs to', |
| 317 |
], |
| 318 |
'phpunit/php-token-stream' => [ |
| 319 |
'version' => '2.0.2', |
| 320 |
'type' => 'library', |
| 321 |
'licenses' => [ 'BSD-3-Clause' ], |
| 322 |
'authors' => [ |
| 323 |
[ |
| 324 |
'name' => 'Sebastian Bergmann', |
| 325 |
'email' => '[email protected]', |
| 326 |
], |
| 327 |
], |
| 328 |
'description' => 'Wrapper around PHP\'s tokenizer extension.', |
| 329 |
], |
| 330 |
'phpunit/php-code-coverage' => [ |
| 331 |
'version' => '5.3.0', |
| 332 |
'type' => 'library', |
| 333 |
'licenses' => [ 'BSD-3-Clause' ], |
| 334 |
'authors' => [ |
| 335 |
[ |
| 336 |
'name' => 'Sebastian Bergmann', |
| 337 |
'email' => '[email protected]', |
| 338 |
'role' => 'lead', |
| 339 |
], |
| 340 |
], |
| 341 |
'description' => 'Library that provides collection, processing, ' . |
| 342 |
'and rendering functionality for PHP code coverage information.', |
| 343 |
], |
| 344 |
'webmozart/assert' => [ |
| 345 |
'version' => '1.2.0', |
| 346 |
'type' => 'library', |
| 347 |
'licenses' => [ 'MIT' ], |
| 348 |
'authors' => [ |
| 349 |
[ |
| 350 |
'name' => 'Bernhard Schussek', |
| 351 |
'email' => '[email protected]', |
| 352 |
], |
| 353 |
], |
| 354 |
'description' => 'Assertions to validate method input/output with ' . |
| 355 |
'nice error messages.', |
| 356 |
], |
| 357 |
'phpdocumentor/reflection-common' => [ |
| 358 |
'version' => '1.0.1', |
| 359 |
'type' => 'library', |
| 360 |
'licenses' => [ 'MIT' ], |
| 361 |
'authors' => [ |
| 362 |
[ |
| 363 |
'name' => 'Jaap van Otterdijk', |
| 364 |
'email' => '[email protected]', |
| 365 |
], |
| 366 |
], |
| 367 |
'description' => 'Common reflection classes used by phpdocumentor to ' . |
| 368 |
'reflect the code structure', |
| 369 |
], |
| 370 |
'phpdocumentor/type-resolver' => [ |
| 371 |
'version' => '0.4.0', |
| 372 |
'type' => 'library', |
| 373 |
'licenses' => [ 'MIT' ], |
| 374 |
'authors' => [ |
| 375 |
[ |
| 376 |
'name' => 'Mike van Riel', |
| 377 |
'email' => '[email protected]', |
| 378 |
], |
| 379 |
], |
| 380 |
'description' => '', |
| 381 |
], |
| 382 |
'phpdocumentor/reflection-docblock' => [ |
| 383 |
'version' => '4.2.0', |
| 384 |
'type' => 'library', |
| 385 |
'licenses' => [ 'MIT' ], |
| 386 |
'authors' => [ |
| 387 |
[ |
| 388 |
'name' => 'Mike van Riel', |
| 389 |
'email' => '[email protected]', |
| 390 |
], |
| 391 |
], |
| 392 |
'description' => 'With this component, a library can provide support for ' . |
| 393 |
'annotations via DocBlocks or otherwise retrieve information that ' . |
| 394 |
'is embedded in a DocBlock.', |
| 395 |
], |
| 396 |
'phpspec/prophecy' => [ |
| 397 |
'version' => '1.7.3', |
| 398 |
'type' => 'library', |
| 399 |
'licenses' => [ 'MIT' ], |
| 400 |
'authors' => [ |
| 401 |
[ |
| 402 |
'name' => 'Konstantin Kudryashov', |
| 403 |
'email' => '[email protected]', |
| 404 |
'homepage' => 'http://everzet.com', |
| 405 |
], |
| 406 |
[ |
| 407 |
'name' => 'Marcello Duarte', |
| 408 |
'email' => '[email protected]', |
| 409 |
], |
| 410 |
], |
| 411 |
'description' => 'Highly opinionated mocking framework for PHP 5.3+', |
| 412 |
], |
| 413 |
'phar-io/version' => [ |
| 414 |
'version' => '1.0.1', |
| 415 |
'type' => 'library', |
| 416 |
'licenses' => [ 'BSD-3-Clause' ], |
| 417 |
'authors' => [ |
| 418 |
[ |
| 419 |
'name' => 'Arne Blankerts', |
| 420 |
'email' => '[email protected]', |
| 421 |
'role' => 'Developer', |
| 422 |
], |
| 423 |
[ |
| 424 |
'name' => 'Sebastian Heuer', |
| 425 |
'email' => '[email protected]', |
| 426 |
'role' => 'Developer', |
| 427 |
], |
| 428 |
[ |
| 429 |
'name' => 'Sebastian Bergmann', |
| 430 |
'email' => '[email protected]', |
| 431 |
'role' => 'Developer', |
| 432 |
], |
| 433 |
], |
| 434 |
'description' => 'Library for handling version information and constraints', |
| 435 |
], |
| 436 |
'phar-io/manifest' => [ |
| 437 |
'version' => '1.0.1', |
| 438 |
'type' => 'library', |
| 439 |
'licenses' => [ 'BSD-3-Clause' ], |
| 440 |
'authors' => [ |
| 441 |
[ |
| 442 |
'name' => 'Arne Blankerts', |
| 443 |
'email' => '[email protected]', |
| 444 |
'role' => 'Developer', |
| 445 |
], |
| 446 |
[ |
| 447 |
'name' => 'Sebastian Heuer', |
| 448 |
'email' => '[email protected]', |
| 449 |
'role' => 'Developer', |
| 450 |
], |
| 451 |
[ |
| 452 |
'name' => 'Sebastian Bergmann', |
| 453 |
'email' => '[email protected]', |
| 454 |
'role' => 'Developer', |
| 455 |
], |
| 456 |
], |
| 457 |
'description' => 'Component for reading phar.io manifest ' . |
| 458 |
'information from a PHP Archive (PHAR)', |
| 459 |
], |
| 460 |
'myclabs/deep-copy' => [ |
| 461 |
'version' => '1.7.0', |
| 462 |
'type' => 'library', |
| 463 |
'licenses' => [ 'MIT' ], |
| 464 |
'authors' => [ |
| 465 |
], |
| 466 |
'description' => 'Create deep copies (clones) of your objects', |
| 467 |
], |
| 468 |
'phpunit/phpunit' => [ |
| 469 |
'version' => '6.5.5', |
| 470 |
'type' => 'library', |
| 471 |
'licenses' => [ 'BSD-3-Clause' ], |
| 472 |
'authors' => [ |
| 473 |
[ |
| 474 |
'name' => 'Sebastian Bergmann', |
| 475 |
'email' => '[email protected]', |
| 476 |
'role' => 'lead', |
| 477 |
], |
| 478 |
], |
| 479 |
'description' => 'The PHP Unit Testing framework.', |
| 480 |
], |
| 481 |
], $installed->getInstalledDependencies() ); |
| 482 |
} |
| 483 |
|
| 484 |
} |