Skip to content

Commit

Permalink
Add test for update all
Browse files Browse the repository at this point in the history
  • Loading branch information
eiriksm committed Jun 21, 2022
1 parent 6bb5bcd commit 6187025
Show file tree
Hide file tree
Showing 4 changed files with 193 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/fixtures/composer.update_all_automerge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"require": {
"psr/log": "^1.1.3"
},
"extra": {
"violinist": {
"always_update_all": 1,
"automerge": 1
}
}
}
69 changes: 69 additions & 0 deletions test/fixtures/composer.update_all_automerge.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"_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": "592003a0c759ae236e67d71f487a0c05",
"packages": [
{
"name": "psr/log",
"version": "1.1.3",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc",
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.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"
],
"support": {
"source": "https://github.com/php-fig/log/tree/1.1.3"
},
"time": "2020-03-23T09:12:05+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"plugin-api-version": "2.3.0"
}
69 changes: 69 additions & 0 deletions test/fixtures/composer.update_all_automerge.lock.updated
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"_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": "592003a0c759ae236e67d71f487a0c05",
"packages": [
{
"name": "psr/log",
"version": "1.1.4",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "d49695b909c3b7628b6289db5479a1c204601f11"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11",
"reference": "d49695b909c3b7628b6289db5479a1c204601f11",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\Log\\": "Psr/Log/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common interface for logging libraries",
"homepage": "https://github.com/php-fig/log",
"keywords": [
"log",
"psr",
"psr-3"
],
"support": {
"source": "https://github.com/php-fig/log/tree/1.1.4"
},
"time": "2021-05-03T11:20:27+00:00"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"plugin-api-version": "2.3.0"
}
44 changes: 44 additions & 0 deletions test/integration/AutomergeUpdateAllTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php

namespace eiriksm\CosyComposerTest\integration;

use Github\Exception\ValidationFailedException;
use Violinist\Slug\Slug;
use Violinist\SymfonyCloudSecurityChecker\SecurityChecker;

/**
* Test for automerge being enabled.
*/
class AutomergeUpdateAllTest extends AutoMergeBase
{
protected $composerAssetFiles = 'composer.update_all_automerge';
protected $hasUpdatedPsrLog = false;
protected $hasUpdatedPsrCache = false;
protected $packageForUpdateOutput = 'psr/log';
protected $packageVersionForFromUpdateOutput = '1.1.3';
protected $packageVersionForToUpdateOutput = '1.1.4';
protected $hasAutoMerge = true;
protected $checkPrUrl = true;
protected $usesDirect = false;

protected function getPrsNamed()
{
if (!$this->isUpdate) {
return [];
}
return [
'violinistall' => [
'base' => [
'sha' => 456,
],
'title' => 'not the same as the other',
'number' => 666,
],
];
}

protected function createExpectedCommandForPackage($package)
{
return 'composer update';
}
}

0 comments on commit 6187025

Please sign in to comment.