Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Fix the fixture generation fo the ComposerOrchestratorTest #823

Merged
merged 2 commits into from
Jan 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ COVERAGE_HTML_DIR = $(COVERAGE_DIR)/html

PHPUNIT_BIN = vendor/bin/phpunit
PHPUNIT = $(PHPUNIT_BIN)
PHPUNIT_TEST_SRC = $(DEFAULT_STUB) $(REQUIREMENT_CHECKER_EXTRACT) fixtures/composer-dump/dir001/vendor fixtures/composer-dump/dir003/vendor
PHPUNIT_TEST_SRC = $(DEFAULT_STUB) $(REQUIREMENT_CHECKER_EXTRACT) fixtures/composer-dump/dir001/vendor fixtures/composer-dump/dir002/vendor fixtures/composer-dump/dir003/vendor
PHPUNIT_COVERAGE_INFECTION = XDEBUG_MODE=coverage php -dphar.readonly=0 $(PHPUNIT) --colors=always --coverage-xml=$(COVERAGE_XML_DIR) --log-junit=$(COVERAGE_JUNIT) --testsuite=Tests
PHPUNIT_COVERAGE_HTML = XDEBUG_MODE=coverage php -dphar.readonly=0 $(PHPUNIT) --colors=always --coverage-html=$(COVERAGE_HTML_DIR)

Expand Down Expand Up @@ -355,6 +355,13 @@ fixtures/composer-dump/dir001/composer.lock: fixtures/composer-dump/dir001/compo
@echo "$(ERROR_COLOR)$(@) is not up to date. You may want to run the following command:$(NO_COLOR)"
@echo "$$ composer update --lock --working-dir=fixtures/composer-dump/dir001 && touch -c $(@)"

fixtures/composer-dump/dir002/vendor: fixtures/composer-dump/dir002/composer.lock
composer install --ansi --working-dir=fixtures/composer-dump/dir002
touch -c $@
fixtures/composer-dump/dir002/composer.lock: fixtures/composer-dump/dir002/composer.json
@echo "$(ERROR_COLOR)$(@) is not up to date. You may want to run the following command:$(NO_COLOR)"
@echo "$$ composer update --lock --working-dir=fixtures/composer-dump/dir002 && touch -c $(@)"

fixtures/composer-dump/dir003/vendor: fixtures/composer-dump/dir003/composer.lock
composer install --ansi --working-dir=fixtures/composer-dump/dir003
touch -c $@
Expand Down
8 changes: 7 additions & 1 deletion tests/Composer/ComposerOrchestratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,17 +442,22 @@ public function test_it_can_dump_the_autoloader_with_a_composer_json_and_lock_wi
'vendor/beberlei/assert/lib/Assert/LazyAssertionException.php',
'vendor/beberlei/assert/LICENSE',
'vendor/composer/autoload_classmap.php',
'vendor/composer/autoload_files.php',
'vendor/composer/autoload_namespaces.php',
'vendor/composer/autoload_psr4.php',
'vendor/composer/autoload_real.php',
'vendor/composer/autoload_static.php',
'vendor/composer/ClassLoader.php',
'vendor/composer/installed.json',
'vendor/composer/installed.php',
'vendor/composer/InstalledVersions.php',
'vendor/composer/LICENSE',
'vendor/composer/platform_check.php',
];

$actualPaths = $this->retrievePaths();

$this->assertSame($expectedPaths, $actualPaths);
$this->assertEqualsCanonicalizing($expectedPaths, $actualPaths);

$this->assertSame(
$expectedAutoloadContents,
Expand All @@ -473,6 +478,7 @@ public function test_it_can_dump_the_autoloader_with_a_composer_json_and_lock_wi
$baseDir = dirname($vendorDir);

return array(
'Assert\\' => array($vendorDir . '/beberlei/assert/lib/Assert'),
);

PHP
Expand Down