SplHeap_extract_invalid_parameter.phpt 1010 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --TEST--
  2. Check that SplHeap::extract generate a warning and returns NULL when param passed
  3. --CREDITS--
  4. PHPNW Testfest 2009 - Simon Westcott (swestcott@gmail.com)
  5. --FILE--
  6. <?php
  7. $data_provider = array(
  8. new stdClass,
  9. array(),
  10. true,
  11. "string",
  12. 12345,
  13. 1.2345,
  14. NULL
  15. );
  16. foreach($data_provider as $input) {
  17. $h = new SplMaxHeap();
  18. var_dump($h->extract($input));
  19. }
  20. ?>
  21. --EXPECTF--
  22. Warning: SplHeap::extract() expects exactly 0 parameters, 1 given in %s on line %d
  23. NULL
  24. Warning: SplHeap::extract() expects exactly 0 parameters, 1 given in %s on line %d
  25. NULL
  26. Warning: SplHeap::extract() expects exactly 0 parameters, 1 given in %s on line %d
  27. NULL
  28. Warning: SplHeap::extract() expects exactly 0 parameters, 1 given in %s on line %d
  29. NULL
  30. Warning: SplHeap::extract() expects exactly 0 parameters, 1 given in %s on line %d
  31. NULL
  32. Warning: SplHeap::extract() expects exactly 0 parameters, 1 given in %s on line %d
  33. NULL
  34. Warning: SplHeap::extract() expects exactly 0 parameters, 1 given in %s on line %d
  35. NULL