Skip to content

Commit 5a485c8

Browse files
authored
Merge pull request #30 from SimonFrings/tests
Clean up test suite and add .gitattributes to exclude dev files from exports
2 parents 8c7b89d + b611352 commit 5a485c8

File tree

5 files changed

+64
-56
lines changed

5 files changed

+64
-56
lines changed

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/.gitattributes export-ignore
2+
/.gitignore export-ignore
3+
/.travis.yml export-ignore
4+
/examples/ export-ignore
5+
/phpunit.xml.dist export-ignore
6+
/tests/ export-ignore

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
"autoload": {
1414
"psr-4": { "Clue\\React\\SQLite\\": "src/" }
1515
},
16+
"autoload-dev": {
17+
"psr-4": { "Clue\\Tests\\React\\SQLite\\": "tests/" }
18+
},
1619
"require": {
1720
"php": ">=5.4",
1821
"ext-sqlite3": "*",

phpunit.xml.dist

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3-
<phpunit bootstrap="vendor/autoload.php"
4-
colors="true"
5-
convertErrorsToExceptions="true"
6-
convertNoticesToExceptions="true"
7-
convertWarningsToExceptions="true"
8-
>
3+
<phpunit bootstrap="vendor/autoload.php" colors="true">
94
<testsuites>
105
<testsuite name="SQLite React Test Suite">
116
<directory>./tests/</directory>

tests/FactoryTest.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
namespace Clue\Tests\React\SQLite;
4+
35
use PHPUnit\Framework\TestCase;
46
use Clue\React\SQLite\Factory;
57

@@ -22,7 +24,7 @@ public function testLoadLazyWithIdleOptionsReturnsDatabaseWithIdleTimeApplied()
2224

2325
$db = $factory->openLazy(':memory:', null, ['idle' => 10.0]);
2426

25-
$ref = new ReflectionProperty($db, 'idlePeriod');
27+
$ref = new \ReflectionProperty($db, 'idlePeriod');
2628
$ref->setAccessible(true);
2729
$value = $ref->getValue($db);
2830

@@ -36,7 +38,7 @@ public function testLoadLazyWithAbsolutePathWillBeUsedAsIs()
3638

3739
$db = $factory->openLazy(__DIR__ . '/users.db');
3840

39-
$ref = new ReflectionProperty($db, 'filename');
41+
$ref = new \ReflectionProperty($db, 'filename');
4042
$ref->setAccessible(true);
4143
$value = $ref->getValue($db);
4244

@@ -50,7 +52,7 @@ public function testLoadLazyWithMemoryPathWillBeUsedAsIs()
5052

5153
$db = $factory->openLazy(':memory:');
5254

53-
$ref = new ReflectionProperty($db, 'filename');
55+
$ref = new \ReflectionProperty($db, 'filename');
5456
$ref->setAccessible(true);
5557
$value = $ref->getValue($db);
5658

@@ -64,7 +66,7 @@ public function testLoadLazyWithEmptyPathWillBeUsedAsIs()
6466

6567
$db = $factory->openLazy('');
6668

67-
$ref = new ReflectionProperty($db, 'filename');
69+
$ref = new \ReflectionProperty($db, 'filename');
6870
$ref->setAccessible(true);
6971
$value = $ref->getValue($db);
7072

@@ -85,7 +87,7 @@ public function testLoadLazyWithRelativePathWillBeResolvedWhenConstructingAndWil
8587

8688
chdir('../');
8789

88-
$ref = new ReflectionProperty($db, 'filename');
90+
$ref = new \ReflectionProperty($db, 'filename');
8991
$ref->setAccessible(true);
9092
$value = $ref->getValue($db);
9193

0 commit comments

Comments
 (0)