Skip to content

Commit

Permalink
Merge 24080c8 into 0ac3e01
Browse files Browse the repository at this point in the history
  • Loading branch information
eiriksm committed Aug 19, 2021
2 parents 0ac3e01 + 24080c8 commit 311ef73
Show file tree
Hide file tree
Showing 4 changed files with 161 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/fixtures/composer-commit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require": {
"psr/log": "~1.0.0"
}
}
57 changes: 57 additions & 0 deletions test/fixtures/composer-commit.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "2865f724e23cffb23b3afd3a968e0359",
"packages": [
{
"name": "psr/log",
"version": "1.0.0",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "fe0936ee26643249e916849d48e3a51d5f5e278b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b",
"reference": "fe0936ee26643249e916849d48e3a51d5f5e278b",
"shasum": ""
},
"type": "library",
"autoload": {
"psr-0": {
"Psr\\Log\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for logging libraries",
"keywords": [
"log",
"psr",
"psr-3"
],
"time": "2012-12-21T11:40:51+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"plugin-api-version": "1.1.0"
}
66 changes: 66 additions & 0 deletions test/fixtures/composer-commit.lock.updated
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "5c85e8d105e895432d3e3efc7ea068c5",
"packages": [
{
"name": "psr/log",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
"reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Log\\": "Psr/Log/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for logging libraries",
"homepage": "https://github.com/php-fig/log",
"keywords": [
"log",
"psr",
"psr-3"
],
"time": "2016-10-10T12:19:37+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"plugin-api-version": "1.1.0"
}
33 changes: 33 additions & 0 deletions test/integration/CommitMessageTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace eiriksm\CosyComposerTest\integration;

/**
* Test for issue 164.
*/
class CommitMessageTest extends ComposerUpdateIntegrationBase
{
protected $packageForUpdateOutput = 'psr/log';
protected $packageVersionForFromUpdateOutput = '1.0.0';
protected $packageVersionForToUpdateOutput = '1.0.2';
protected $composerAssetFiles = 'composer-commit';
protected $hasCorrectCommit = false;

public function testRequireDevAdded()
{
$this->runtestExpectedOutput();
self::assertEquals($this->hasCorrectCommit, true);
}

protected function handleExecutorReturnCallback($cmd, &$return)
{
if (strpos($cmd, $this->getCorrectCommit())) {
$this->hasCorrectCommit = true;
}
}

protected function getCorrectCommit()
{
return 'git commit composer.json composer.lock -m "Update psr/log"';
}
}

0 comments on commit 311ef73

Please sign in to comment.