Skip to content
Permalink
Browse files
Add failing JSONP service
While trying to improve my fix for jquerygh-4250, I needed a failing service.
This will be parked on a side branch until it is ever needed.  Which may
be never.

Signed-off-by: Sean Robinson <sean.robinson@scottsdalecc.edu>
  • Loading branch information
skrobinson committed Jun 12, 2019
1 parent 355f39d commit 4f0a90f990369e7eb9d8f5742312c3906b9594b1
Showing with 7 additions and 1 deletion.
  1. +7 −1 test/data/mock.php
@@ -219,7 +219,13 @@ protected function cspClean( $req ) {
protected function errorWithScript( $req ) {
header( 'HTTP/1.0 404 Not Found' );
header( 'Content-Type: application/javascript' );
echo 'QUnit.assert.ok( false, "Mock return erroneously executed" );';
if ( isset( $req->query['callback'] ) ) {
// JSONP return should run to get data
$callback = $req->query['callback'];
echo $callback . '( {"data": {"lang": "en", "length": 25}} )';
} else {
echo 'QUnit.assert.ok( false, "Mock return erroneously executed" );';
}
}

public function __construct() {

0 comments on commit 4f0a90f

Please sign in to comment.