Skip to content

Commit 99e9173

Browse files
committed
Add mbregex tests
1 parent 89560c3 commit 99e9173

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

packages/php-wasm/node/src/test/php.spec.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1512,6 +1512,27 @@ bar1
15121512
});
15131513
});
15141514

1515+
/**
1516+
* mbregex support
1517+
*/
1518+
describe('mbregex extension support', () => {
1519+
it('Should be able to use mb_regex_encoding functions', async () => {
1520+
const response = await php.run({
1521+
code: `<?php
1522+
mb_regex_encoding('UTF-8');
1523+
?>`,
1524+
});
1525+
// We don't support mbregex in PHP 7.0
1526+
if (phpVersion === '7.0') {
1527+
expect(response.errors).toContain(
1528+
'Call to undefined function mb_regex_encoding'
1529+
);
1530+
} else {
1531+
expect(response.errors).toBe('');
1532+
}
1533+
});
1534+
});
1535+
15151536
describe('onMessage', () => {
15161537
it('should pass messages to JS', async () => {
15171538
let messageReceived = '';

0 commit comments

Comments
 (0)