From 3304bf7a03aebbe12cb0538795cf6023f694477d Mon Sep 17 00:00:00 2001 From: Dan Phillimore Date: Sun, 24 Mar 2024 20:48:55 +0000 Subject: [PATCH] Add test for violation of void return type --- test/integration/types/voidTypeTest.js | 27 +++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/test/integration/types/voidTypeTest.js b/test/integration/types/voidTypeTest.js index 49cb053..a7ddb0d 100644 --- a/test/integration/types/voidTypeTest.js +++ b/test/integration/types/voidTypeTest.js @@ -11,7 +11,9 @@ var expect = require('chai').expect, nowdoc = require('nowdoc'), - tools = require('../tools'); + phpCommon = require('phpcommon'), + tools = require('../tools'), + PHPFatalError = phpCommon.PHPFatalError; describe('PHP void return type integration', function () { it('should allow functions that have no explicit return or return void', async function () { @@ -50,4 +52,27 @@ EOS 'return void': 101 }); }); + + it('should raise an error when a value is returned with void return type', async function () { + var php = nowdoc(function () {/*<<