Skip to content

Commit 4ebb103

Browse files
authored
Merge pull request #267 from cweagans/remove-dependency-patch-resolution
Remove dependency patch resolution
2 parents fc8a477 + c32d533 commit 4ebb103

File tree

10 files changed

+70
-179
lines changed

10 files changed

+70
-179
lines changed

src/Capability/CoreResolverProvider.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace cweagans\Composer\Capability;
44

5-
use cweagans\Composer\Resolvers\DependencyPatches;
65
use cweagans\Composer\Resolvers\PatchesFile;
76
use cweagans\Composer\Resolvers\RootComposer;
87

@@ -16,7 +15,6 @@ public function getResolvers()
1615
return [
1716
new RootComposer($this->composer, $this->io),
1817
new PatchesFile($this->composer, $this->io),
19-
new DependencyPatches($this->composer, $this->io),
2018
];
2119
}
2220
}

src/Resolvers/DependencyPatches.php

Lines changed: 0 additions & 68 deletions
This file was deleted.

tests/_support/_generated/UnitTesterActions.php

Lines changed: 69 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
<?php //[STAMP] 5648e2ecd2668319703f108f1329e8a8
1+
<?php //[STAMP] 5e4c7302c0b63a4df799dc88da465f39
22
namespace _generated;
33

44
// This class was automatically generated by build task
55
// You should not change it manually as it will be overwritten on next build
66
// @codingStandardsIgnoreFile
77

8-
use Codeception\Module\Asserts;
9-
use Helper\Unit;
10-
118
trait UnitTesterActions
129
{
1310
/**
@@ -26,13 +23,13 @@ abstract protected function getScenario();
2623
* Regular example:
2724
* ```php
2825
* <?php
29-
* $I->assertEquals($element->getChildrenCount(), 5);
26+
* $I->assertEquals(5, $element->getChildrenCount());
3027
* ```
3128
*
3229
* Floating-point example:
3330
* ```php
3431
* <?php
35-
* $I->assertEquals($calculator->add(0.1, 0.2), 0.3, 'Calculator should add the two numbers correctly.', 0.01);
32+
* $I->assertEquals(0.3, $calculator->add(0.1, 0.2), 'Calculator should add the two numbers correctly.', 0.01);
3633
* ```
3734
*
3835
* @param $expected
@@ -56,13 +53,13 @@ public function assertEquals($expected, $actual, $message = null, $delta = null)
5653
* Regular example:
5754
* ```php
5855
* <?php
59-
* $I->assertNotEquals($element->getChildrenCount(), 0);
56+
* $I->assertNotEquals(0, $element->getChildrenCount());
6057
* ```
6158
*
6259
* Floating-point example:
6360
* ```php
6461
* <?php
65-
* $I->assertNotEquals($calculator->add(0.1, 0.2), 0.4, 'Calculator should add the two numbers correctly.', 0.01);
62+
* $I->assertNotEquals(0.4, $calculator->add(0.1, 0.2), 'Calculator should add the two numbers correctly.', 0.01);
6663
* ```
6764
*
6865
* @param $expected
@@ -326,6 +323,20 @@ public function assertTrue($condition, $message = null) {
326323
}
327324

328325

326+
/**
327+
* [!] Method is generated. Documentation taken from corresponding module.
328+
*
329+
* Checks that the condition is NOT true (everything but true)
330+
*
331+
* @param $condition
332+
* @param string $message
333+
* @see \Codeception\Module\Asserts::assertNotTrue()
334+
*/
335+
public function assertNotTrue($condition, $message = null) {
336+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotTrue', func_get_args()));
337+
}
338+
339+
329340
/**
330341
* [!] Method is generated. Documentation taken from corresponding module.
331342
*
@@ -340,6 +351,20 @@ public function assertFalse($condition, $message = null) {
340351
}
341352

342353

354+
/**
355+
* [!] Method is generated. Documentation taken from corresponding module.
356+
*
357+
* Checks that the condition is NOT false (everything but false)
358+
*
359+
* @param $condition
360+
* @param string $message
361+
* @see \Codeception\Module\Asserts::assertNotFalse()
362+
*/
363+
public function assertNotFalse($condition, $message = null) {
364+
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotFalse', func_get_args()));
365+
}
366+
367+
343368
/**
344369
* [!] Method is generated. Documentation taken from corresponding module.
345370
*
@@ -540,9 +565,45 @@ public function fail($message) {
540565
*
541566
* @param $exception string or \Exception
542567
* @param $callback
568+
*
569+
* @deprecated Use expectThrowable instead
543570
* @see \Codeception\Module\Asserts::expectException()
544571
*/
545572
public function expectException($exception, $callback) {
546573
return $this->getScenario()->runStep(new \Codeception\Step\Action('expectException', func_get_args()));
547574
}
575+
576+
577+
/**
578+
* [!] Method is generated. Documentation taken from corresponding module.
579+
*
580+
* Handles and checks throwables (Exceptions/Errors) called inside the callback function.
581+
* Either throwable class name or throwable instance should be provided.
582+
*
583+
* ```php
584+
* <?php
585+
* $I->expectThrowable(MyThrowable::class, function() {
586+
* $this->doSomethingBad();
587+
* });
588+
*
589+
* $I->expectThrowable(new MyException(), function() {
590+
* $this->doSomethingBad();
591+
* });
592+
* ```
593+
* If you want to check message or throwable code, you can pass them with throwable instance:
594+
* ```php
595+
* <?php
596+
* // will check that throwable MyError is thrown with "Don't do bad things" message
597+
* $I->expectThrowable(new MyError("Don't do bad things"), function() {
598+
* $this->doSomethingBad();
599+
* });
600+
* ```
601+
*
602+
* @param $throwable string or \Throwable
603+
* @param $callback
604+
* @see \Codeception\Module\Asserts::expectThrowable()
605+
*/
606+
public function expectThrowable($throwable, $callback) {
607+
return $this->getScenario()->runStep(new \Codeception\Step\Action('expectThrowable', func_get_args()));
608+
}
548609
}

tests/acceptance/ApplyPatchFromDependencyCept.php

Lines changed: 0 additions & 6 deletions
This file was deleted.

tests/acceptance/DontApplyPatchFromDependencyCept.php

Lines changed: 0 additions & 6 deletions
This file was deleted.

tests/acceptance/fixtures/apply-patch-from-dependency/composer.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

tests/acceptance/fixtures/dont-apply-patch-from-dependency/composer.json

Lines changed: 0 additions & 25 deletions
This file was deleted.
Binary file not shown.

tests/unit/CoreResolverProviderTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ public function testGetResolvers()
1818

1919
$resolvers = $resolverProvider->getResolvers();
2020

21-
$this->assertCount(3, $resolvers);
21+
$this->assertCount(2, $resolvers);
2222
$this->assertInstanceOf(\cweagans\Composer\Resolvers\RootComposer::class, $resolvers[0]);
2323
$this->assertInstanceOf(\cweagans\Composer\Resolvers\PatchesFile::class, $resolvers[1]);
24-
$this->assertInstanceOf(\cweagans\Composer\Resolvers\DependencyPatches::class, $resolvers[2]);
2524
}
2625
}

tests/unit/DependencyPatchesResolverTest.php

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)