Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to use PSR-4 autoloader #22

Merged
merged 1 commit into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
"phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36"
},
"autoload": {
"psr-0": {
"Clue\\Redis\\Protocol": "src/"
"psr-4": {
"Clue\\Redis\\Protocol\\": "src/"
}
} ,
"autoload-dev": {
"psr-0": {
"": "tests/"
"psr-4": {
"Clue\\Tests\\Redis\\Protocol\\": "tests/"
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions tests/FactoryTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\Redis\Protocol;

use Clue\Redis\Protocol\Factory;

class FactoryTest extends TestCase
Expand Down
3 changes: 3 additions & 0 deletions tests/Model/AbstractModelTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php

namespace Clue\Tests\Redis\Protocol\Model;

use Clue\Redis\Protocol\Serializer\RecursiveSerializer;
use Clue\Tests\Redis\Protocol\TestCase;

abstract class AbstractModelTest extends TestCase
{
Expand Down
2 changes: 2 additions & 0 deletions tests/Model/BulkReplyTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\Redis\Protocol\Model;

use Clue\Redis\Protocol\Model\BulkReply;

class BulkReplyTest extends AbstractModelTest
Expand Down
2 changes: 2 additions & 0 deletions tests/Model/ErrorReplyTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\Redis\Protocol\Model;

use Clue\Redis\Protocol\Model\ErrorReply;

class ErrorReplyTest extends AbstractModelTest
Expand Down
2 changes: 2 additions & 0 deletions tests/Model/IntegerReplyTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\Redis\Protocol\Model;

use Clue\Redis\Protocol\Model\IntegerReply;

class IntegerReplyTest extends AbstractModelTest
Expand Down
2 changes: 2 additions & 0 deletions tests/Model/MultiBulkReplyTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\Redis\Protocol\Model;

use Clue\Redis\Protocol\Model\BulkReply;
use Clue\Redis\Protocol\Model\IntegerReply;
use Clue\Redis\Protocol\Model\MultiBulkReply;
Expand Down
2 changes: 2 additions & 0 deletions tests/Model/RequestTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\Redis\Protocol\Model;

use Clue\Redis\Protocol\Model\Request;

class RequestTest extends AbstractModelTest
Expand Down
2 changes: 2 additions & 0 deletions tests/Model/StatusReplyTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\Redis\Protocol\Model;

use Clue\Redis\Protocol\Model\StatusReply;

class StatusReplyTest extends AbstractModelTest
Expand Down
3 changes: 3 additions & 0 deletions tests/Parser/AbstractParserTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?php

namespace Clue\Tests\Redis\Protocol\Parser;

use Clue\Redis\Protocol\Parser\MessageBuffer;
use Clue\Redis\Protocol\Parser\ParserInterface;
use Clue\Tests\Redis\Protocol\TestCase;

abstract class AbstractParserTest extends TestCase
{
Expand Down
2 changes: 2 additions & 0 deletions tests/Parser/RequestParserTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\Redis\Protocol\Parser;

use Clue\Redis\Protocol\Model\Request;
use Clue\Redis\Protocol\Parser\RequestParser;

Expand Down
2 changes: 2 additions & 0 deletions tests/Parser/ResponseParserTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\Redis\Protocol\Parser;

use Clue\Redis\Protocol\Parser\ResponseParser;

class ResponseParserTest extends AbstractParserTest
Expand Down
7 changes: 5 additions & 2 deletions tests/Serializer/AbstractSerializerTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php

namespace Clue\Tests\Redis\Protocol\Serializer;

use Clue\Redis\Protocol\Serializer\SerializerInterface;
use Clue\Tests\Redis\Protocol\TestCase;

abstract class AbstractSerializerTest extends TestCase
{
Expand Down Expand Up @@ -88,10 +91,10 @@ public function testArrayMultiBulkReply()

public function testErrorReply()
{
$model = $this->serializer->createReplyModel(new Exception('ERR failure'));
$model = $this->serializer->createReplyModel(new \Exception('ERR failure'));
$this->assertInstanceOf('Clue\Redis\Protocol\Model\ErrorReply', $model);
$this->assertEquals('ERR failure', $model->getValueNative());
$this->assertEquals($model->getMessageSerialized($this->serializer), $this->serializer->getReplyMessage(new Exception('ERR failure')));
$this->assertEquals($model->getMessageSerialized($this->serializer), $this->serializer->getReplyMessage(new \Exception('ERR failure')));
}

public function testInvalidArgument()
Expand Down
2 changes: 2 additions & 0 deletions tests/Serializer/RecursiveSerializerTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\Redis\Protocol\Serializer;

use Clue\Redis\Protocol\Serializer\RecursiveSerializer;

class RecursiveSerializerTest extends AbstractSerializerTest
Expand Down
6 changes: 5 additions & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?php

class TestCase extends \PHPUnit\Framework\TestCase
namespace Clue\Tests\Redis\Protocol;

use PHPUnit\Framework\TestCase as BaseTestCase;

class TestCase extends BaseTestCase
{
public function setExpectedException($exception, $exceptionMessage = '', $exceptionCode = null)
{
Expand Down