コード例 #1
0
 public function test_multiple_binary()
 {
     $this->bs_local->start(array('v' => true));
     $bs_local_2 = new Local();
     $log_file2 = getcwd() . '/log2.log';
     print $log_file2;
     try {
         $bs_local_2->start(array('v' => true, 'logfile' => $log_file2));
         $this->fail("Expected Exception has not been raised.");
     } catch (LocalException $ex) {
         $emessage = $ex->getMessage();
         $this->assertEquals(trim($emessage), 'Either another browserstack local client is running on your machine or some server is listening on port 45691');
         unlink($log_file2);
         return;
     }
 }
コード例 #2
0
<?php

// An example of using php-browserstacklocal
namespace BrowserStack;

require_once 'vendor/autoload.php';
use BrowserStack\Local;
use BrowserStack\LocalException;
$me = new Local();
$me->isRunning();
echo "starting";
$args = array("-v" => 1);
$me->start($args);
echo "started";
echo $me->isRunning();
echo "stopping";
$me->stop();
echo "stopped";
echo $me->isRunning();