classUnsupportedSqlException
final class UnsupportedSqlException
extends SimulationException
Refuses a statement ZTD cannot simulate.
ZTD never writes to the database, so a statement it cannot work out the effect of is refused rather than run. The statement is carried whole, because what a caller needs in order to act on this is which statement was refused, not only that one was.
Methods§
public function __construct(
string $sql,
string $category = 'Unsupported',
Throwable|null $previous = null,
)Parameters
$sql | string | The statement being refused, as written |
$category | string | What about it ZTD cannot simulate |
$previous | Throwable|null | What made this impossible, where something did |
Test cases 5
UnsupportedSqlExceptionTest::testGetCategoryReturnsCategorycoversUnsupportedSqlExceptionTest::testGetCategoryReturnsDefaultCategorycoversUnsupportedSqlExceptionTest::testGetMessageReturnsFormattedMessagecoversUnsupportedSqlExceptionTest::testGetMessageWithDefaultCategorycoversUnsupportedSqlExceptionTest::testGetSqlReturnsOriginalSqlcovers
Calls 2
- static-call SimulationException::__construct() line 32
- function-call
sprintfline 32
public function getSql(): stringAnswers the statement being refused.
Returns
string The statement, as writtenTest cases 1
UnsupportedSqlExceptionTest::testGetSqlReturnsOriginalSqlcovers and calls
public function getCategory(): stringAnswers what about the statement ZTD cannot simulate.
Returns
string What was refusedTest cases 2
UnsupportedSqlExceptionTest::testGetCategoryReturnsCategorycovers and callsUnsupportedSqlExceptionTest::testGetCategoryReturnsDefaultCategorycovers and calls
Private surface 2§
Implementation details, listed for orientation only.
private string $sqlprivate string $categoryTest cases 33§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 5
UnsupportedSqlExceptionTest::testGetCategoryReturnsCategorycovers and callsUnsupportedSqlExceptionTest::testGetCategoryReturnsDefaultCategorycovers and callsUnsupportedSqlExceptionTest::testGetMessageReturnsFormattedMessagecovers and callsUnsupportedSqlExceptionTest::testGetMessageWithDefaultCategorycovers and callsUnsupportedSqlExceptionTest::testGetSqlReturnsOriginalSqlcovers and calls
Other tests reaching this symbol 28
RewriterContractTest::testEmptyInputThrowsExceptioncallsRewriterContractTest::testUnsupportedSqlThrowsExceptioncallsFakeSqlRewriter::rewritecallsFakeSqlRewriter::rewriteDdlcallsFakeSqlRewriter::rewriteWritecallsRewritePlanTestcallsRewriteRefusalTest::testForUnsupportedAnswersAPlanThatDoesNothingWhereTheCallerAllowsThatcallsRewriteRefusalTest::testForUnsupportedRaisesWhereTheCallerAskedToBeToldcallsRewriteRefusalTest::testForUnsupportedSaysSomethingWhereTheCallerAskedToBeNoticedcallsUpsertColumnTest::testOfRefusesANameTheRowAnswersToInNoCasingcallsUpsertComparisonTest::testOfRefusesANumberAgainstTextcallsUpsertComparisonTest::testOfRefusesTextAgainstANumbercallsUpsertComparisonTest::testTextRefusesAValueWithNoTextFormcallsUpsertNumberTest::testDivideRefusesAZeroDivisorcallsUpsertNumberTest::testDivideRefusesAZeroDivisorWrittenAsAFloatcallsUpsertNumberTest::testModuloRefusesADivisorThatIsZeroOnceItIsAWholeNumbercallsUpsertNumberTest::testOfRefusesABooleanBecauseArithmeticOnItIsNotSomethingSqlAgreesOncallsUpsertNumberTest::testOfRefusesTextThatIsNotWrittenAsANumbercallsUpsertTruthTest::testOfRefusesAValueThatIsNeitherBooleanNorANumbercallsUpsertExpressionTest::testRejectsDivisionByZerocallsUpsertExpressionTest::testRejectsModuloByZerocallsUpsertExpressionTest::testRejectsNonNumericArithmeticOperandcallsUpsertMutationTest::testDatabaseEvaluatedBatchRejectsStaleUnsupportedExpressioncallsUpsertUpdateTest::testAppliesRefusesAConditionTheDatabaseCouldNotWorkOutForARowAlreadyChangedcallsUpsertUpdateTest::testAppliesRefusesAConditionTheDatabaseDidNotWorkOutAtAllcallsUpsertUpdateTest::testPredicateReadRefusesAConditionZtdCouldNotReadcallsUpsertUpdateTest::testWithColumnRefusesAnAssignmentTheDatabaseCouldNotWorkOutcallsStatementSimulatorTest::testUnsupportedSqlThrowscalls
Relations§
Instantiated in 9
- new ZtdQuery\Shadow\Mutation\Upsert\UpsertColumn::of() packages/ztd-query-core/src/Shadow/Mutation/Upsert/UpsertColumn.php:41
- new ZtdQuery\Shadow\Mutation\Upsert\UpsertComparison::of() packages/ztd-query-core/src/Shadow/Mutation/Upsert/UpsertComparison.php:46
- new ZtdQuery\Shadow\Mutation\Upsert\UpsertComparison::of() packages/ztd-query-core/src/Shadow/Mutation/Upsert/UpsertComparison.php:55
- new ZtdQuery\Shadow\Mutation\Upsert\UpsertComparison::text() packages/ztd-query-core/src/Shadow/Mutation/Upsert/UpsertComparison.php:82
- new ZtdQuery\Shadow\Mutation\Upsert\UpsertNumber::of() packages/ztd-query-core/src/Shadow/Mutation/Upsert/UpsertNumber.php:39
- new ZtdQuery\Shadow\Mutation\Upsert\UpsertNumber::divide() packages/ztd-query-core/src/Shadow/Mutation/Upsert/UpsertNumber.php:163
- new ZtdQuery\Shadow\Mutation\Upsert\UpsertNumber::modulo() packages/ztd-query-core/src/Shadow/Mutation/Upsert/UpsertNumber.php:192
- new ZtdQuery\Shadow\Mutation\UpsertUpdate::predicateRead() packages/ztd-query-core/src/Shadow/Mutation/UpsertUpdate.php:193
- new ZtdQuery\Shadow\Mutation\UpsertUpdate::valueRead() packages/ztd-query-core/src/Shadow/Mutation/UpsertUpdate.php:213