dev/core#3979 - Add test to reproduce error
authorTim Otten <totten@civicrm.org>
Fri, 18 Nov 2022 01:12:48 +0000 (17:12 -0800)
committerTim Otten <totten@civicrm.org>
Fri, 18 Nov 2022 01:15:19 +0000 (17:15 -0800)
Note: On current D7, this doesn't actually reproduce the message because `bootstrap.inc` redirects it

```
function _drupal_bootstrap_configuration() {
  // Set the Drupal custom error handler.
  set_error_handler('_drupal_error_handler');
  set_exception_handler('_drupal_exception_handler');
```

But if you comment out `set_error_handler()`, then it does. And I presume it would on D8+...

tests/phpunit/E2E/Api4/LocaleTest.php [new file with mode: 0644]

diff --git a/tests/phpunit/E2E/Api4/LocaleTest.php b/tests/phpunit/E2E/Api4/LocaleTest.php
new file mode 100644 (file)
index 0000000..9fa21cd
--- /dev/null
@@ -0,0 +1,23 @@
+<?php
+
+namespace E2E\Api4;
+
+/**
+ * Class LocaleTest
+ * @package E2E\Api4
+ * @group e2e
+ */
+class LocaleTest extends \CiviEndToEndTestCase {
+
+  /**
+   * Ensure that
+   */
+  public function testSetLanguage() {
+    $contacts = civicrm_api4('Contact', 'get', [
+      'limit' => 25,
+      'language' => 'en_US',
+    ]);
+    $this->assertTrue(count($contacts) > 0);
+  }
+
+}