Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestSuite cannot handle @expect annotation with empty 'withMessage' attribute #135

Closed
kiesel opened this issue Mar 14, 2016 · 4 comments
Closed
Labels
Milestone

Comments

@kiesel
Copy link
Member

kiesel commented Mar 14, 2016

Given a test like:

  #[@test, @ignore, @expect(class= 'lang.Throwable', withMessage= '')]
  public function expect_some_exception() {
  // ...
  }

This leads to:

$ unittest src/test/php
[............................................................NNNUncaught exception: Exception lang.reflect.TargetInvocationException (xp.unittest.Runner::main)
  at lang.reflect.Method::invoke(NULL, array[1]) [line 350 of class-main.php]
Caused by Exception lang.IndexOutOfBoundsException (Uninitialized string offset: 0)
  at <main>::__error(8, (0x1e)'Uninitialized string offset: 0', (0x70)'/home/idev/dev/xp.private/trunk/xp5/libs/ibus/vendor/xp-framewor', 248, array[6]) [line 248 of TestSuite.class.php]
  at unittest.TestSuite::runInternal(org.oneandone.ibus.command.MessageConsumerCommandTest{}, unittest.TestResult{}) [line 565 of TestSuite.class.php]
  at unittest.TestSuite::run() [line 369 of Runner.class.php]
  at xp.unittest.Runner::run(array[1]) [line 380 of Runner.class.php]
  at xp.unittest.Runner::main(array[1]) [line 0 of StackTraceElement.class.php]
  at ReflectionMethod::invokeArgs(NULL, array[1]) [line 90 of Method.class.php]
@thekid
Copy link
Member

thekid commented Mar 17, 2016

This issue belongs to xp-framework/unittest, test are no longer part of core since XP7 (see xp-framework/rfc#293)

thekid added a commit to xp-framework/unittest that referenced this issue Mar 17, 2016
@thekid
Copy link
Member

thekid commented Mar 17, 2016

@thekid thekid closed this as completed Mar 17, 2016
@thekid thekid added the invalid label Mar 17, 2016
@kiesel
Copy link
Member Author

kiesel commented Mar 17, 2016

Cool, thanks. But we should backport this, shouldn't we?

@thekid
Copy link
Member

thekid commented Mar 18, 2016

But we should backport this, shouldn't we?

OK, you're right:

@thekid thekid added bug and removed invalid labels Mar 18, 2016
@thekid thekid added this to the 6.11.2 milestone Mar 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants