Skip to content

[test infrastructure] TextEditTest fails due to lack of AssertionError if assertions are off #254

Closed
@TysonAndre

Description

@TysonAndre

Steps to reproduce: set zend.assertions = -1 in the PHP ini, run TextEditTest in phpunit.

See http://php.net/manual/en/function.assert.php#function.assert.expectations

Solutions:

  • Change the code to throw OutOfBoundsException (or have an explicit throw statement for AssertionError) instead of using assert() so that the behavior of TextEdit::applyEdits is always consistent. If TextEdit::applyEdits is a public API (is it? I don't see it used anywhere), this may make sense to do.
  • Skip the test based on the value of zend.assertions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions