Skip to content

Commit

Permalink
SchedulerExtension: fix error message for case when neither 'callback…
Browse files Browse the repository at this point in the history
…' nor 'job' or both options are defined
  • Loading branch information
mabar committed Jan 26, 2024
1 parent ae2541c commit 7a114cf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- stderr handling in subprocesses - causes an exception
- stdout handling in subprocesses - causes a notice, instead of an exception

### Fixed

- `SchedulerExtension` - error message for case when neither `callback` nor `job` or both options are defined

## [1.0.2](https://github.com/orisai/nette-scheduler/compare/1.0.1...1.0.2) - 2023-10-05

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/DI/SchedulerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function getConfigSchema(): Schema
}

return $values->callback !== null || $values->job !== null;
}, "Use either 'callback' or 'assert'"),
}, "Use either 'callback' or 'job'"),
),
]);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/DI/SchedulerExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ public function testInvalidJobDefinition(string $config): void

$this->expectException(InvalidConfigurationException::class);
$this->expectExceptionMessage(
"Failed assertion 'Use either 'callback' or 'assert'' for item 'orisai.scheduler › jobs › example' with value object stdClass.",
"Failed assertion 'Use either 'callback' or 'job'' for item 'orisai.scheduler › jobs › example' with value object stdClass.",
);

$configurator->createContainer();
Expand Down

0 comments on commit 7a114cf

Please sign in to comment.