stop() public static method

Stop running the node.js server
public static stop ( )
<?php

namespace GuzzleHttp\Test;

require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/Server.php';
use GuzzleHttp\Tests\Server;
Server::start();
register_shutdown_function(function () {
    Server::stop();
});
// Override curl_setopt_array() to get the last set curl options
namespace GuzzleHttp\Handler;

function curl_setopt_array($handle, array $options)
{
    if (!empty($_SERVER['curl_test'])) {
        $_SERVER['_curl'] = $options;
    } else {
        unset($_SERVER['_curl']);
    }
    \curl_setopt_array($handle, $options);
}
Example #2
0
<?php

/**
 *
 * Original Author: Davey Shafik <*****@*****.**>
 *
 * For more information visit https://developer.akamai.com
 *
 * Copyright 2014 Akamai Technologies, Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
require_once __DIR__ . '/../vendor/autoload.php';
\GuzzleHttp\Tests\Server::start();
register_shutdown_function(function () {
    \GuzzleHttp\Tests\Server::stop();
});
 public function setUp()
 {
     \GuzzleHttp\Tests\Server::stop();
     \GuzzleHttp\Tests\Server::start();
 }
 public static function tearDownAfterClass()
 {
     Server::stop();
 }
 protected function tearDown()
 {
     Server::stop();
 }