aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/php
diff options
context:
space:
mode:
authorGravatar David Garcia Quintas <dgq@google.com>2016-04-25 10:54:21 -0700
committerGravatar David Garcia Quintas <dgq@google.com>2016-04-25 10:54:21 -0700
commit178ebc92ba865bfcde10f5d06a49112db0f2e363 (patch)
treef0f092f27ba45669912918c4b33e1a1b2b91fe25 /src/php
parente5c485d47d742600a61b2f6ac0bd47bfa762bb5c (diff)
parentbf2315cbdfa70d6abf7d3f012c5cb3dce6aa36ff (diff)
Merge branch 'master' of github.com:grpc/grpc into lb_pollset_propagation
Diffstat (limited to 'src/php')
-rw-r--r--src/php/ext/grpc/server_credentials.c9
-rw-r--r--src/php/tests/bootstrap.php2
-rw-r--r--src/php/tests/generated_code/GeneratedCodeWithCallbackTest.php3
-rw-r--r--src/php/tests/generated_code/math_client.php4
-rw-r--r--src/php/tests/unit_tests/CallCredentials3Test.php1
-rwxr-xr-xsrc/php/tests/unit_tests/CallTest.php3
-rw-r--r--src/php/tests/unit_tests/ChannelCredentialsTest.php2
-rw-r--r--src/php/tests/unit_tests/ChannelTest.php3
-rwxr-xr-xsrc/php/tests/unit_tests/EndToEndTest.php8
-rw-r--r--src/php/tests/unit_tests/ServerTest.php3
-rwxr-xr-xsrc/php/tests/unit_tests/TimevalTest.php15
11 files changed, 25 insertions, 28 deletions
diff --git a/src/php/ext/grpc/server_credentials.c b/src/php/ext/grpc/server_credentials.c
index 79188246bc..f3951b31fe 100644
--- a/src/php/ext/grpc/server_credentials.c
+++ b/src/php/ext/grpc/server_credentials.c
@@ -115,10 +115,11 @@ PHP_METHOD(ServerCredentials, createSsl) {
"createSsl expects 3 strings", 1 TSRMLS_CC);
return;
}
- /* TODO: add a force_client_auth field in ServerCredentials and pass it as
- * the last parameter. */
- grpc_server_credentials *creds = grpc_ssl_server_credentials_create(
- pem_root_certs, &pem_key_cert_pair, 1, 0, NULL);
+ /* TODO: add a client_certificate_request field in ServerCredentials and pass
+ * it as the last parameter. */
+ grpc_server_credentials *creds = grpc_ssl_server_credentials_create_ex(
+ pem_root_certs, &pem_key_cert_pair, 1,
+ GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE, NULL);
zval *creds_object = grpc_php_wrap_server_credentials(creds);
RETURN_DESTROY_ZVAL(creds_object);
}
diff --git a/src/php/tests/bootstrap.php b/src/php/tests/bootstrap.php
index b61f2c40a5..8b3d4347e2 100644
--- a/src/php/tests/bootstrap.php
+++ b/src/php/tests/bootstrap.php
@@ -17,5 +17,5 @@
*/
error_reporting(E_ALL | E_STRICT);
-require dirname(__DIR__) . '/vendor/autoload.php';
+require dirname(__DIR__).'/vendor/autoload.php';
date_default_timezone_set('UTC');
diff --git a/src/php/tests/generated_code/GeneratedCodeWithCallbackTest.php b/src/php/tests/generated_code/GeneratedCodeWithCallbackTest.php
index 6bb1955ccb..6b70b8ac10 100644
--- a/src/php/tests/generated_code/GeneratedCodeWithCallbackTest.php
+++ b/src/php/tests/generated_code/GeneratedCodeWithCallbackTest.php
@@ -46,7 +46,8 @@ class GeneratedCodeWithCallbackTest extends AbstractGeneratedCodeTest
$a_copy['foo'] = ['bar'];
return $a_copy;
- }]);
+ },
+ ]);
}
public function tearDown()
diff --git a/src/php/tests/generated_code/math_client.php b/src/php/tests/generated_code/math_client.php
index b8652ceb08..6ee92bc465 100644
--- a/src/php/tests/generated_code/math_client.php
+++ b/src/php/tests/generated_code/math_client.php
@@ -38,13 +38,13 @@ include 'tests/generated_code/math.php';
function p($line)
{
- print("$line<br/>\n");
+ echo "$line<br/>\n";
}
$host = 'localhost:50051';
p("Connecting to host: $host");
$client = new math\MathClient($host, [
- 'credentials' => Grpc\ChannelCredentials::createInsecure()
+ 'credentials' => Grpc\ChannelCredentials::createInsecure(),
]);
p('Client class: '.get_class($client));
p('');
diff --git a/src/php/tests/unit_tests/CallCredentials3Test.php b/src/php/tests/unit_tests/CallCredentials3Test.php
index 6d98815d16..8f5e109bf5 100644
--- a/src/php/tests/unit_tests/CallCredentials3Test.php
+++ b/src/php/tests/unit_tests/CallCredentials3Test.php
@@ -132,5 +132,4 @@ class CallCredentials3Test extends PHPUnit_Framework_TestCase
unset($call);
unset($server_call);
}
-
}
diff --git a/src/php/tests/unit_tests/CallTest.php b/src/php/tests/unit_tests/CallTest.php
index 1170a440fa..fa026f0935 100755
--- a/src/php/tests/unit_tests/CallTest.php
+++ b/src/php/tests/unit_tests/CallTest.php
@@ -94,7 +94,7 @@ class CallTest extends PHPUnit_Framework_TestCase
public function testCancel()
{
- $this->assertNull($this->call->cancel());
+ $this->assertNull($this->call->cancel());
}
/**
@@ -118,5 +118,4 @@ class CallTest extends PHPUnit_Framework_TestCase
];
$result = $this->call->startBatch($batch);
}
-
}
diff --git a/src/php/tests/unit_tests/ChannelCredentialsTest.php b/src/php/tests/unit_tests/ChannelCredentialsTest.php
index 1a42d69428..56c1d8f006 100644
--- a/src/php/tests/unit_tests/ChannelCredentialsTest.php
+++ b/src/php/tests/unit_tests/ChannelCredentialsTest.php
@@ -70,4 +70,4 @@ class ChanellCredentialsTest extends PHPUnit_Framework_TestCase
$channel_credentials = Grpc\ChannelCredentials::createInsecure();
$this->assertNull($channel_credentials);
}
-} \ No newline at end of file
+}
diff --git a/src/php/tests/unit_tests/ChannelTest.php b/src/php/tests/unit_tests/ChannelTest.php
index b6eac3109a..a1f9053c39 100644
--- a/src/php/tests/unit_tests/ChannelTest.php
+++ b/src/php/tests/unit_tests/ChannelTest.php
@@ -78,5 +78,4 @@ class ChannelTest extends PHPUnit_Framework_TestCase
]
);
}
-
-} \ No newline at end of file
+}
diff --git a/src/php/tests/unit_tests/EndToEndTest.php b/src/php/tests/unit_tests/EndToEndTest.php
index 3fa92c950b..2b09f9d112 100755
--- a/src/php/tests/unit_tests/EndToEndTest.php
+++ b/src/php/tests/unit_tests/EndToEndTest.php
@@ -261,7 +261,8 @@ class EndToEndTest extends PHPUnit_Framework_TestCase
Grpc\OP_SEND_INITIAL_METADATA => [],
Grpc\OP_SEND_CLOSE_FROM_CLIENT => true,
Grpc\OP_SEND_MESSAGE => ['message' => 'abc',
- 'flags' => 'invalid'],
+ 'flags' => 'invalid',
+ ],
]);
}
@@ -574,7 +575,7 @@ class EndToEndTest extends PHPUnit_Framework_TestCase
public function testGetConnectivityStateInvalidParam()
{
$this->assertTrue($this->channel->getConnectivityState(
- new Grpc\Timeval));
+ new Grpc\Timeval()));
}
/**
@@ -591,12 +592,11 @@ class EndToEndTest extends PHPUnit_Framework_TestCase
*/
public function testChannelConstructorInvalidParam()
{
- $this->channel = new Grpc\Channel('localhost:'.$this->port, NULL);
+ $this->channel = new Grpc\Channel('localhost:'.$this->port, null);
}
public function testClose()
{
$this->assertNull($this->channel->close());
}
-
}
diff --git a/src/php/tests/unit_tests/ServerTest.php b/src/php/tests/unit_tests/ServerTest.php
index d18f9abe9b..76aaa06970 100644
--- a/src/php/tests/unit_tests/ServerTest.php
+++ b/src/php/tests/unit_tests/ServerTest.php
@@ -67,5 +67,4 @@ class ServerTest extends PHPUnit_Framework_TestCase
$this->server = new Grpc\Server([]);
$this->port = $this->server->addSecureHttp2Port(['0.0.0.0:0']);
}
-
-} \ No newline at end of file
+}
diff --git a/src/php/tests/unit_tests/TimevalTest.php b/src/php/tests/unit_tests/TimevalTest.php
index 43abba126a..a3dbce079f 100755
--- a/src/php/tests/unit_tests/TimevalTest.php
+++ b/src/php/tests/unit_tests/TimevalTest.php
@@ -94,13 +94,13 @@ class TimevalTest extends PHPUnit_Framework_TestCase
public function testSimilar()
{
- $a = Grpc\Timeval::now();
- $delta = new Grpc\Timeval(1000);
- $b = $a->add($delta);
- $thresh = new Grpc\Timeval(1100);
- $this->assertTrue(Grpc\Timeval::similar($a, $b, $thresh));
- $thresh = new Grpc\Timeval(900);
- $this->assertFalse(Grpc\Timeval::similar($a, $b, $thresh));
+ $a = Grpc\Timeval::now();
+ $delta = new Grpc\Timeval(1000);
+ $b = $a->add($delta);
+ $thresh = new Grpc\Timeval(1100);
+ $this->assertTrue(Grpc\Timeval::similar($a, $b, $thresh));
+ $thresh = new Grpc\Timeval(900);
+ $this->assertFalse(Grpc\Timeval::similar($a, $b, $thresh));
}
public function testSleepUntil()
@@ -155,5 +155,4 @@ class TimevalTest extends PHPUnit_Framework_TestCase
{
$a = Grpc\Timeval::similar(1000, 1100, 1200);
}
-
}