From d32cea1988170977cbb14e141f01f8adb9c4d9dd Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sat, 16 Aug 2014 10:53:32 +0200 Subject: [PATCH] Removed tests that had crept in --- tests/util/RedirectUriTest.php | 15 ---- tests/util/RequestTest.php | 87 ------------------- tests/util/SecureKeyTest.php | 32 ------- .../key_algorithm/DefaultAlgorithmTest.php | 22 ----- 4 files changed, 156 deletions(-) delete mode 100644 tests/util/RedirectUriTest.php delete mode 100644 tests/util/RequestTest.php delete mode 100644 tests/util/SecureKeyTest.php delete mode 100644 tests/util/key_algorithm/DefaultAlgorithmTest.php diff --git a/tests/util/RedirectUriTest.php b/tests/util/RedirectUriTest.php deleted file mode 100644 index 07b913ba..00000000 --- a/tests/util/RedirectUriTest.php +++ /dev/null @@ -1,15 +0,0 @@ -'bar')); - $v2 = League\OAuth2\Server\Util\RedirectUri::make('https://foobar/', array('foo'=>'bar'), '#'); - $v3 = League\OAuth2\Server\Util\RedirectUri::make('https://foobar/', array('foo'=>'bar', 'bar' => 'foo')); - - $this->assertEquals('https://foobar/?foo=bar', $v1); - $this->assertEquals('https://foobar/#foo=bar', $v2); - $this->assertEquals('https://foobar/?foo=bar&bar=foo', $v3); - } -} diff --git a/tests/util/RequestTest.php b/tests/util/RequestTest.php deleted file mode 100644 index 1f6de94a..00000000 --- a/tests/util/RequestTest.php +++ /dev/null @@ -1,87 +0,0 @@ -request = new League\OAuth2\Server\Util\Request( - array('foo' => 'bar'), - array('foo' => 'bar'), - array('foo' => 'bar'), - array('foo' => 'bar'), - array('HTTP_HOST' => 'foobar.com') - ); - } - - function test_buildFromIndex() - { - $r = new League\OAuth2\Server\Util\Request(); - $r->buildFromGlobals(); - - $this->assertTrue($r instanceof League\OAuth2\Server\Util\Request); - } - - function test_get() - { - $this->assertEquals('bar', $this->request->get('foo')); - $this->assertEquals(array('foo' => 'bar'), $this->request->get()); - } - - function test_post() - { - $this->assertEquals('bar', $this->request->post('foo')); - $this->assertEquals(array('foo' => 'bar'), $this->request->post()); - } - - function test_file() - { - $this->assertEquals('bar', $this->request->file('foo')); - $this->assertEquals(array('foo' => 'bar'), $this->request->file()); - } - - function test_cookie() - { - $this->assertEquals('bar', $this->request->cookie('foo')); - $this->assertEquals(array('foo' => 'bar'), $this->request->cookie()); - } - - function test_server() - { - $this->assertEquals('foobar.com', $this->request->server('HTTP_HOST')); - $this->assertEquals(array('HTTP_HOST' => 'foobar.com'), $this->request->server()); - } - - function test_header() - { - $this->assertEquals('foobar.com', $this->request->header('Host')); - $this->assertEquals(array('Host' => 'foobar.com'), $this->request->header()); - } - - function test_canonical_header() - { - $request = new League\OAuth2\Server\Util\Request( - array('foo' => 'bar'), - array('foo' => 'bar'), - array('foo' => 'bar'), - array('foo' => 'bar'), - array('HTTP_HOST' => 'foobar.com'), - array('authorization' => 'Bearer ajdfkljadslfjasdlkj') - ); - - $this->assertEquals('Bearer ajdfkljadslfjasdlkj', $request->header('Authorization')); - } - - /** - * @expectedException InvalidArgumentException - */ - function test_unknownProperty() - { - $reflector = new ReflectionClass($this->request); - $method = $reflector->getMethod('getPropertyValue'); - $method->setAccessible(true); - - $method->invoke($this->request, 'blah'); - } -} diff --git a/tests/util/SecureKeyTest.php b/tests/util/SecureKeyTest.php deleted file mode 100644 index da59bee4..00000000 --- a/tests/util/SecureKeyTest.php +++ /dev/null @@ -1,32 +0,0 @@ -assertEquals(40, strlen($v1)); - $this->assertTrue($v1 !== $v2); - $this->assertEquals(50, strlen($v3)); - } - - public function test_make_with_different_algorithm() - { - $algorithm = $this->getMock('League\OAuth2\Server\Util\KeyAlgorithm\KeyAlgorithmInterface'); - - $result = 'dasdsdsaads'; - $algorithm - ->expects($this->once()) - ->method('make') - ->with(11) - ->will($this->returnValue($result)) - ; - - League\OAuth2\Server\Util\SecureKey::setAlgorithm($algorithm); - $this->assertSame($algorithm, League\OAuth2\Server\Util\SecureKey::getAlgorithm()); - $this->assertEquals($result, League\OAuth2\Server\Util\SecureKey::make(11)); - } -} diff --git a/tests/util/key_algorithm/DefaultAlgorithmTest.php b/tests/util/key_algorithm/DefaultAlgorithmTest.php deleted file mode 100644 index 2e78ea1b..00000000 --- a/tests/util/key_algorithm/DefaultAlgorithmTest.php +++ /dev/null @@ -1,22 +0,0 @@ -make(); - $v2 = $algorithm->make(); - $v3 = $algorithm->make(50); - - $this->assertEquals(40, strlen($v1)); - $this->assertTrue($v1 !== $v2); - $this->assertEquals(50, strlen($v3)); - } -} \ No newline at end of file