File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 1414{
1515 public function __construct (
1616 private ReleasesInterface $ releases ,
17- private VersionParser $ versionParser = new VersionParser () ,
17+ private VersionParser $ versionParser = new VersionParser ,
1818 ) {}
1919
2020 /**
@@ -36,6 +36,5 @@ public function satisfiedBy(string $constraint): array
3636 previous: $ e
3737 );
3838 }
39-
4039 }
4140}
Original file line number Diff line number Diff line change 55namespace Tests \Unit \Matrices ;
66
77use Mockery ;
8+ use Throwable ;
89use TypistTech \PhpMatrix \Exceptions \UnexpectedValueException ;
910use TypistTech \PhpMatrix \Matrices \Matrix ;
1011use TypistTech \PhpMatrix \Matrices \MatrixInterface ;
8182
8283 $ matrix ->satisfiedBy ('invalid constraint ' );
8384 })->throws (UnexpectedValueException::class);
85+
86+ it ('does not invoke ReleasesInterface::all() when invalid constraint ' , function () {
87+ $ releases = Mockery::mock (ReleasesInterface::class);
88+
89+ $ releases ->expects ()
90+ ->all ()
91+ ->withAnyArgs ()
92+ ->never ();
93+
94+ $ matrix = new Matrix ($ releases );
95+
96+ try {
97+ $ matrix ->satisfiedBy ('invalid constraint ' );
98+ } catch (Throwable $ e ) {
99+ // No-op.
100+ }
101+ });
84102 });
85103});
You can’t perform that action at this time.
0 commit comments