diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 282131b..d44a72f 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -22,7 +22,7 @@ checks: tools: external_code_coverage: timeout: 600 - runs: 3 + runs: 2 php_code_sniffer: enabled: true config: diff --git a/.travis.yml b/.travis.yml index 5c475de..62f99f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,6 @@ language: php sudo: false php: - - 5.6 - 7.0 - 7.1 - nightly @@ -13,7 +12,7 @@ matrix: - php: nightly env: - - TESTBENCH_VERSION=3.4.* + - TESTBENCH_VERSION=3.5.* before_script: - travis_retry composer self-update diff --git a/README.md b/README.md index ecd9409..8655325 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ If you discover any security related issues, please email arcanedev-maroc@gmail. Any ideas are welcome. Feel free to submit any issues or pull requests, please check the [contribution guidelines](CONTRIBUTING.md). -[badge_laravel]: https://img.shields.io/badge/For-Laravel%205.x-orange.svg?style=flat-square +[badge_laravel]: https://img.shields.io/badge/Laravel-5.4%20to%205.5-orange.svg?style=flat-square [badge_license]: https://img.shields.io/packagist/l/arcanedev/laravel-tracker.svg?style=flat-square [badge_build]: https://img.shields.io/travis/ARCANEDEV/LaravelTracker.svg?style=flat-square diff --git a/composer.json b/composer.json index 2902b2c..19aa003 100644 --- a/composer.json +++ b/composer.json @@ -16,18 +16,18 @@ "type": "library", "license": "MIT", "require": { - "php": ">=5.6.4", - "arcanedev/geo-ip": "~2.0", - "arcanedev/support": "~4.0", - "jaybizzle/crawler-detect": "~1.0", - "arcanedev/agent": "~2.0", - "ramsey/uuid": "~3.0", + "php": ">=7.0", + "arcanedev/agent": "~3.0", + "arcanedev/geo-ip": "~2.2", + "arcanedev/support": "~4.2", + "jaybizzle/crawler-detect": "~1.2", + "ramsey/uuid": "~3.6", "snowplow/referer-parser": "~0.2", - "ua-parser/uap-php" : "~3.0" + "ua-parser/uap-php" : "~3.4" }, "require-dev": { - "phpunit/phpcov": "~3.0", - "phpunit/phpunit": "~5.0" + "phpunit/phpcov": "~4.0", + "phpunit/phpunit": "~6.0" }, "autoload": { "psr-4": { @@ -39,7 +39,17 @@ "Arcanedev\\LaravelTracker\\Tests\\": "tests/" } }, + "extra": { + "laravel": { + "providers": [ + "Arcanedev\\LaravelTracker\\LaravelTrackerServiceProvider" + ], + "aliases": { + "Tracker": "Arcanedev\\LaravelTracker\\Facades\\Tracker" + } + } + }, "scripts": { - "testbench": "composer require --dev \"orchestra/testbench-browser-kit=~3.4.0\" \"orchestra/database=~3.4.0\"" + "testbench": "composer require --dev \"orchestra/testbench-browser-kit=~3.5.0\" \"orchestra/database=~3.5.0\"" } } diff --git a/src/Contracts/Trackers/RouteTracker.php b/src/Contracts/Trackers/RouteTracker.php index 39fd104..35f9306 100644 --- a/src/Contracts/Trackers/RouteTracker.php +++ b/src/Contracts/Trackers/RouteTracker.php @@ -23,7 +23,7 @@ interface RouteTracker * * @return bool */ - public function isTrackable($route); + public function isTrackable(Route $route); /** * Track the matched route. @@ -31,7 +31,7 @@ public function isTrackable($route); * @param \Illuminate\Routing\Route $route * @param \Illuminate\Http\Request $request * - * @return mixed + * @return int */ public function track(Route $route, Request $request); } diff --git a/src/Trackers/RouteTracker.php b/src/Trackers/RouteTracker.php index 6ca8f25..3223d65 100644 --- a/src/Trackers/RouteTracker.php +++ b/src/Trackers/RouteTracker.php @@ -43,7 +43,7 @@ protected function getModel() * * @return bool */ - public function isTrackable($route) + public function isTrackable(Route $route) { return ! $this->isInIgnoredRouteNames($route) && ! $this->isInIgnoredUris($route); @@ -91,7 +91,7 @@ private function trackRoute(Route $route) * * @return bool */ - private function isInIgnoredRouteNames($route) + private function isInIgnoredRouteNames(Route $route) { return $this->checkPatterns( $route->getName(), $this->getConfig('routes.ignore.names', []) @@ -105,7 +105,7 @@ private function isInIgnoredRouteNames($route) * * @return bool */ - private function isInIgnoredUris($route) + private function isInIgnoredUris(Route $route) { return $this->checkPatterns( $route->uri(), $this->getConfig('routes.ignore.uris', []) @@ -174,11 +174,13 @@ private function trackRoutePathParameters(Route $route, Models\RoutePath $routeP { $parameters = []; - foreach ($route->parameters() as $parameter => $value) { - $parameters[] = $this->makeModel(BindingManager::MODEL_ROUTE_PATH_PARAMETER)->fill([ - 'parameter' => $parameter, - 'value' => $this->checkIfValueIsEloquentModel($value), - ]); + if ($route->hasParameters()) { + foreach ($route->parameters() as $parameter => $value) { + $parameters[] = $this->makeModel(BindingManager::MODEL_ROUTE_PATH_PARAMETER)->fill([ + 'parameter' => $parameter, + 'value' => $this->checkIfValueIsEloquentModel($value), + ]); + } } if (count($parameters) > 0) diff --git a/tests/Exceptions/ExceptionFactoryTest.php b/tests/Exceptions/ExceptionFactoryTest.php index 4bedcfd..4567f00 100644 --- a/tests/Exceptions/ExceptionFactoryTest.php +++ b/tests/Exceptions/ExceptionFactoryTest.php @@ -12,10 +12,11 @@ */ class ExceptionFactoryTest extends TestCase { - /* ------------------------------------------------------------------------------------------------ - | Test Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Tests + | ----------------------------------------------------------------- */ + /** @test */ public function it_can_make() { @@ -37,10 +38,11 @@ public function it_can_make_default_if_not_supported() ); } - /* ------------------------------------------------------------------------------------------------ - | Other Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Other Methods + | ----------------------------------------------------------------- */ + /** * Get the supported error exceptions. * diff --git a/tests/LaravelTrackerServiceProviderTest.php b/tests/LaravelTrackerServiceProviderTest.php index 94fa742..e75152b 100644 --- a/tests/LaravelTrackerServiceProviderTest.php +++ b/tests/LaravelTrackerServiceProviderTest.php @@ -8,17 +8,19 @@ */ class LaravelTrackerServiceProviderTest extends TestCase { - /* ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- | Properties - | ------------------------------------------------------------------------------------------------ + | ----------------------------------------------------------------- */ + /** @var \Arcanedev\LaravelTracker\LaravelTrackerServiceProvider */ protected $provider; - /* ------------------------------------------------------------------------------------------------ - | Main Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Main Methods + | ----------------------------------------------------------------- */ + public function setUp() { parent::setUp(); @@ -33,10 +35,11 @@ public function tearDown() parent::tearDown(); } - /* ------------------------------------------------------------------------------------------------ - | Test Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Tests + | ----------------------------------------------------------------- */ + /** @test */ public function it_can_be_instantiated() { diff --git a/tests/MigrationsTest.php b/tests/MigrationsTest.php index a9d2b46..6e7a384 100644 --- a/tests/MigrationsTest.php +++ b/tests/MigrationsTest.php @@ -10,10 +10,11 @@ */ class MigrationsTest extends TestCase { - /* ------------------------------------------------------------------------------------------------ - | Test Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Tests + | ----------------------------------------------------------------- */ + /** @test */ public function it_can_publish_migrations() { @@ -44,10 +45,11 @@ public function it_can_migrate() } } - /* ------------------------------------------------------------------------------------------------ - | Other Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Other Methods + | ----------------------------------------------------------------- */ + private function getTablesNames($prefix = 'tracker_') { $tables = array_map(function ($table) use ($prefix) { diff --git a/tests/TestCase.php b/tests/TestCase.php index d83c08a..2840c63 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -10,10 +10,11 @@ */ abstract class TestCase extends BaseTestCase { - /* ------------------------------------------------------------------------------------------------ - | Main Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Main Methods + | ----------------------------------------------------------------- */ + public function setUp() { parent::setUp(); @@ -138,10 +139,11 @@ function () { }); } - /* ------------------------------------------------------------------------------------------------ - | Other Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Other Methods + | ----------------------------------------------------------------- */ + /** * Migrate the migrations. */ diff --git a/tests/TrackerTest.php b/tests/TrackerTest.php index 11ca457..12c08df 100644 --- a/tests/TrackerTest.php +++ b/tests/TrackerTest.php @@ -8,17 +8,19 @@ */ class TrackerTest extends TestCase { - /* ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- | Properties - | ------------------------------------------------------------------------------------------------ + | ----------------------------------------------------------------- */ + /** @var \Arcanedev\LaravelTracker\Tracker */ private $tracker; - /* ------------------------------------------------------------------------------------------------ - | Main Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Main Methods + | ----------------------------------------------------------------- */ + public function setUp() { parent::setUp(); @@ -35,10 +37,11 @@ public function tearDown() parent::tearDown(); } - /* ------------------------------------------------------------------------------------------------ - | Test Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Tests + | ----------------------------------------------------------------- */ + /** @test */ public function it_can_be_instantiated() { @@ -89,6 +92,12 @@ public function it_can_track() // Without an authenticated user $this->call('GET', '/'); - // TODO: Complete the implementation + $activities = \Arcanedev\LaravelTracker\Models\VisitorActivity::all(); + + $this->assertCount(1, $activities); + + $this->assertNull($activities->first()->error_id); + + // TODO: Adding more test assertions ? } } diff --git a/tests/Trackers/CookieTrackerTest.php b/tests/Trackers/CookieTrackerTest.php index 047919c..b71c0b1 100644 --- a/tests/Trackers/CookieTrackerTest.php +++ b/tests/Trackers/CookieTrackerTest.php @@ -8,17 +8,19 @@ */ class CookieTrackerTest extends TestCase { - /* ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- | Properties - | ------------------------------------------------------------------------------------------------ + | ----------------------------------------------------------------- */ + /** @var \Arcanedev\LaravelTracker\Contracts\Trackers\CookieTracker */ private $tracker; - /* ------------------------------------------------------------------------------------------------ - | Main Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Main Methods + | ----------------------------------------------------------------- */ + public function setUp() { parent::setUp(); @@ -33,10 +35,11 @@ public function tearDown() parent::tearDown(); } - /* ------------------------------------------------------------------------------------------------ - | Test Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Tests + | ----------------------------------------------------------------- */ + /** @test */ public function it_can_be_instantiated() { diff --git a/tests/Trackers/DeviceTrackerTest.php b/tests/Trackers/DeviceTrackerTest.php index 48babb2..f53357a 100644 --- a/tests/Trackers/DeviceTrackerTest.php +++ b/tests/Trackers/DeviceTrackerTest.php @@ -8,17 +8,19 @@ */ class DeviceTrackerTest extends TestCase { - /* ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- | Properties - | ------------------------------------------------------------------------------------------------ + | ----------------------------------------------------------------- */ + /** @var \Arcanedev\LaravelTracker\Contracts\Trackers\DeviceTracker */ private $tracker; - /* ------------------------------------------------------------------------------------------------ - | Main Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Main Methods + | ----------------------------------------------------------------- */ + public function setUp() { parent::setUp(); @@ -33,10 +35,11 @@ public function tearDown() parent::tearDown(); } - /* ------------------------------------------------------------------------------------------------ - | Test Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Tests + | ----------------------------------------------------------------- */ + /** @test */ public function it_can_be_instantiated() { diff --git a/tests/Trackers/ErrorTrackerTest.php b/tests/Trackers/ErrorTrackerTest.php index fa65099..f80a441 100644 --- a/tests/Trackers/ErrorTrackerTest.php +++ b/tests/Trackers/ErrorTrackerTest.php @@ -8,17 +8,19 @@ */ class ErrorTrackerTest extends TestCase { - /* ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- | Properties - | ------------------------------------------------------------------------------------------------ + | ----------------------------------------------------------------- */ + /** @var \Arcanedev\LaravelTracker\Contracts\Trackers\ErrorTracker */ private $tracker; - /* ------------------------------------------------------------------------------------------------ - | Main Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Main Methods + | ----------------------------------------------------------------- */ + public function setUp() { parent::setUp(); @@ -33,10 +35,11 @@ public function tearDown() parent::tearDown(); } - /* ------------------------------------------------------------------------------------------------ - | Test Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Tests + | ----------------------------------------------------------------- */ + /** @test */ public function it_can_be_instantiated() { @@ -70,10 +73,18 @@ public function it_can_track_an_exception_with_handler() try { $this->call('GET', 'page-not-found'); } - catch (\Exception $e) { + catch (\Exception $e) {} - } + $errors = \Arcanedev\LaravelTracker\Models\Error::all(); + + $this->assertCount(1, $errors); + + /** @var \Arcanedev\LaravelTracker\Models\Error $error */ + $error = $errors->first(); + + $this->assertSame('404', $error->code); + $this->assertSame('', $error->message); - // TODO: Complete the test assertions + // TODO: Adding more test assertions ? } } diff --git a/tests/Trackers/GeoIpTrackerTest.php b/tests/Trackers/GeoIpTrackerTest.php index 0296068..af95967 100644 --- a/tests/Trackers/GeoIpTrackerTest.php +++ b/tests/Trackers/GeoIpTrackerTest.php @@ -8,17 +8,19 @@ */ class GeoIpTrackerTest extends TestCase { - /* ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- | Properties - | ------------------------------------------------------------------------------------------------ + | ----------------------------------------------------------------- */ + /** @var \Arcanedev\LaravelTracker\Contracts\Trackers\GeoIpTracker */ private $tracker; - /* ------------------------------------------------------------------------------------------------ - | Main Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Main Methods + | ----------------------------------------------------------------- */ + public function setUp() { parent::setUp(); @@ -33,10 +35,11 @@ public function tearDown() parent::tearDown(); } - /* ------------------------------------------------------------------------------------------------ - | Test Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Tests + | ----------------------------------------------------------------- */ + /** @test */ public function it_can_be_instantiated() { diff --git a/tests/Trackers/LanguageTrackerTest.php b/tests/Trackers/LanguageTrackerTest.php index 6ecbb38..6f90212 100644 --- a/tests/Trackers/LanguageTrackerTest.php +++ b/tests/Trackers/LanguageTrackerTest.php @@ -8,17 +8,19 @@ */ class LanguageTrackerTest extends TestCase { - /* ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- | Properties - | ------------------------------------------------------------------------------------------------ + | ----------------------------------------------------------------- */ + /** @var \Arcanedev\LaravelTracker\Contracts\Trackers\LanguageTracker */ private $tracker; - /* ------------------------------------------------------------------------------------------------ - | Main Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Main Methods + | ----------------------------------------------------------------- */ + public function setUp() { parent::setUp(); @@ -33,10 +35,11 @@ public function tearDown() parent::tearDown(); } - /* ------------------------------------------------------------------------------------------------ - | Test Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Tests + | ----------------------------------------------------------------- */ + /** @test */ public function it_can_be_instantiated() { diff --git a/tests/Trackers/PathTrackerTest.php b/tests/Trackers/PathTrackerTest.php index 7ba4ce1..364b451 100644 --- a/tests/Trackers/PathTrackerTest.php +++ b/tests/Trackers/PathTrackerTest.php @@ -8,17 +8,19 @@ */ class PathTrackerTest extends TestCase { - /* ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- | Properties - | ------------------------------------------------------------------------------------------------ + | ----------------------------------------------------------------- */ + /** @var \Arcanedev\LaravelTracker\Contracts\Trackers\PathTracker */ private $tracker; - /* ------------------------------------------------------------------------------------------------ - | Main Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Main Methods + | ----------------------------------------------------------------- */ + public function setUp() { parent::setUp(); @@ -33,10 +35,11 @@ public function tearDown() parent::tearDown(); } - /* ------------------------------------------------------------------------------------------------ - | Test Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Tests + | ----------------------------------------------------------------- */ + /** @test */ public function it_can_be_instantiated() { diff --git a/tests/Trackers/QueryTrackerTest.php b/tests/Trackers/QueryTrackerTest.php index 58d60bb..6ecd054 100644 --- a/tests/Trackers/QueryTrackerTest.php +++ b/tests/Trackers/QueryTrackerTest.php @@ -8,17 +8,19 @@ */ class QueryTrackerTest extends TestCase { - /* ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- | Properties - | ------------------------------------------------------------------------------------------------ + | ----------------------------------------------------------------- */ + /** @var \Arcanedev\LaravelTracker\Contracts\Trackers\QueryTracker */ protected $tracker; - /* ------------------------------------------------------------------------------------------------ - | Main Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Main Methods + | ----------------------------------------------------------------- */ + public function setUp() { parent::setUp(); @@ -33,10 +35,11 @@ public function tearDown() parent::tearDown(); } - /* ------------------------------------------------------------------------------------------------ - | Test Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Tests + | ----------------------------------------------------------------- */ + /** @test */ public function it_can_track() { diff --git a/tests/Trackers/RefererTrackerTest.php b/tests/Trackers/RefererTrackerTest.php index f4b13af..a0aba98 100644 --- a/tests/Trackers/RefererTrackerTest.php +++ b/tests/Trackers/RefererTrackerTest.php @@ -8,17 +8,19 @@ */ class RefererTrackerTest extends TestCase { - /* ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- | Properties - | ------------------------------------------------------------------------------------------------ + | ----------------------------------------------------------------- */ + /** @var \Arcanedev\LaravelTracker\Contracts\Trackers\RefererTracker */ private $tracker; - /* ------------------------------------------------------------------------------------------------ - | Main Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Main Methods + | ----------------------------------------------------------------- */ + public function setUp() { parent::setUp(); @@ -33,10 +35,11 @@ public function tearDown() parent::tearDown(); } - /* ------------------------------------------------------------------------------------------------ - | Test Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Tests + | ----------------------------------------------------------------- */ + /** @test */ public function it_can_be_instantiated() { diff --git a/tests/Trackers/RouteTrackerTest.php b/tests/Trackers/RouteTrackerTest.php index c4ea827..f7f7da3 100644 --- a/tests/Trackers/RouteTrackerTest.php +++ b/tests/Trackers/RouteTrackerTest.php @@ -65,7 +65,19 @@ public function it_can_check_if_trackable() /** @test */ public function it_can_track() { - // TODO: Add database assertions + $route = $this->makeContactRoute(); + + $this->assertSame(1, $this->tracker->track($route, request())); + + $routes = \Arcanedev\LaravelTracker\Models\Route::all(); + + $this->assertCount(1, $routes); + + /** @var \Arcanedev\LaravelTracker\Models\Route $route */ + $route = $routes->first(); + + $this->assertSame('public::contact.get', $route->name); + $this->assertSame('Closure', $route->action); } /** @test */ diff --git a/tests/Trackers/TestCase.php b/tests/Trackers/TestCase.php index 68033bb..446fe34 100644 --- a/tests/Trackers/TestCase.php +++ b/tests/Trackers/TestCase.php @@ -10,10 +10,11 @@ */ abstract class TestCase extends BaseTestCase { - /* ------------------------------------------------------------------------------------------------ - | Main Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Main Methods + | ----------------------------------------------------------------- */ + public function setUp() { parent::setUp(); diff --git a/tests/Trackers/UserAgentTrackerTest.php b/tests/Trackers/UserAgentTrackerTest.php index f4906d9..509600e 100644 --- a/tests/Trackers/UserAgentTrackerTest.php +++ b/tests/Trackers/UserAgentTrackerTest.php @@ -8,17 +8,19 @@ */ class UserAgentTrackerTest extends TestCase { - /* ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- | Properties - | ------------------------------------------------------------------------------------------------ + | ----------------------------------------------------------------- */ + /** @var \Arcanedev\LaravelTracker\Contracts\Trackers\UserAgentTracker */ private $tracker; - /* ------------------------------------------------------------------------------------------------ - | Main Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Main Methods + | ----------------------------------------------------------------- */ + public function setUp() { parent::setUp(); @@ -33,10 +35,11 @@ public function tearDown() parent::tearDown(); } - /* ------------------------------------------------------------------------------------------------ - | Test Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Test Methods + | ----------------------------------------------------------------- */ + /** @test */ public function it_can_be_instantiated() { diff --git a/tests/Trackers/UserTrackerTest.php b/tests/Trackers/UserTrackerTest.php index c7f24b7..88a66ba 100644 --- a/tests/Trackers/UserTrackerTest.php +++ b/tests/Trackers/UserTrackerTest.php @@ -8,17 +8,19 @@ */ class UserTrackerTest extends TestCase { - /* ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- | Properties - | ------------------------------------------------------------------------------------------------ + | ----------------------------------------------------------------- */ + /** @var \Arcanedev\LaravelTracker\Contracts\Trackers\UserTracker */ private $tracker; - /* ------------------------------------------------------------------------------------------------ - | Main Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Main Methods + | ----------------------------------------------------------------- */ + public function setUp() { parent::setUp(); @@ -33,10 +35,11 @@ public function tearDown() parent::tearDown(); } - /* ------------------------------------------------------------------------------------------------ - | Test Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Test Methods + | ----------------------------------------------------------------- */ + /** @test */ public function it_can_be_instantiated() { diff --git a/tests/Trackers/VisitorActivityTrackerTest.php b/tests/Trackers/VisitorActivityTrackerTest.php index 9482b0c..72ef7e1 100644 --- a/tests/Trackers/VisitorActivityTrackerTest.php +++ b/tests/Trackers/VisitorActivityTrackerTest.php @@ -8,17 +8,19 @@ */ class VisitorActivityTrackerTest extends TestCase { - /* ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- | Properties - | ------------------------------------------------------------------------------------------------ + | ----------------------------------------------------------------- */ + /** @var \Arcanedev\LaravelTracker\Contracts\Trackers\VisitorActivityTracker */ private $tracker; - /* ------------------------------------------------------------------------------------------------ - | Main Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Main Methods + | ----------------------------------------------------------------- */ + public function setUp() { parent::setUp(); @@ -33,10 +35,11 @@ public function tearDown() parent::tearDown(); } - /* ------------------------------------------------------------------------------------------------ - | Test Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Tests + | ----------------------------------------------------------------- */ + /** @test */ public function it_can_be_instantiated() { diff --git a/tests/Trackers/VisitorTrackerTest.php b/tests/Trackers/VisitorTrackerTest.php index 846ab1c..f835562 100644 --- a/tests/Trackers/VisitorTrackerTest.php +++ b/tests/Trackers/VisitorTrackerTest.php @@ -8,17 +8,19 @@ */ class VisitorTrackerTest extends TestCase { - /* ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- | Properties - | ------------------------------------------------------------------------------------------------ + | ----------------------------------------------------------------- */ + /** @var \Arcanedev\LaravelTracker\Contracts\Trackers\VisitorTracker */ private $tracker; - /* ------------------------------------------------------------------------------------------------ - | Main Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Main Methods + | ----------------------------------------------------------------- */ + public function setUp() { parent::setUp(); @@ -33,10 +35,11 @@ public function tearDown() parent::tearDown(); } - /* ------------------------------------------------------------------------------------------------ - | Test Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Test Methods + | ----------------------------------------------------------------- */ + /** @test */ public function it_can_be_instantiated() { @@ -60,10 +63,11 @@ public function it_can_track() // TODO: Add database assertions } - /* ------------------------------------------------------------------------------------------------ - | Other Functions - | ------------------------------------------------------------------------------------------------ + /* ----------------------------------------------------------------- + | Other Methods + | ----------------------------------------------------------------- */ + /** * Get the visitor data. *