Skip to content

Commit

Permalink
Merge pull request #11 from smoskalenko/php7-compatibility
Browse files Browse the repository at this point in the history
PHP7 compatibility
  • Loading branch information
Magomogo authored Aug 3, 2018
2 parents 307dc94 + 1109d14 commit b6f21dc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 24 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
dist: precise
language: php
php:
- "5.3"
- "5.4"
- "5.5"
- "5.6"
- "7.0"
- "7.1"
- "7.2"

services:
- MySQL
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
"description": "A way to make domain-specific models persistent",
"homepage": "https://github.com/Magomogo/persisted-models",
"require": {
"php":">=5.3.0",
"doctrine/dbal": "2.3.0"
"php":">=5.6.0",
"doctrine/dbal": "~2.5.0"
},
"require-dev": {
"ext-pdo": "*",
"ext-pdo_mysql": "*",
"ext-pdo_pgsql": "*",
"ext-pdo_sqlite": "*",
"mockery/mockery": "~0.9.0",
"phpunit/phpunit": "~4.8.0",
"phpunit/phpunit": "~5.7.0",
"hamcrest/hamcrest-php": "~2.0.0",
"doctrine/couchdb": "@dev"
},
Expand Down
22 changes: 4 additions & 18 deletions test/Persisted/Container/SqlDb/SchemaCreatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,8 @@ public function testCreatesATableForPersonProperties()
{
self::schema($this->connection->getSchemaManager())->schemaFor(Person::maxim());

$this->assertSame(
self::asOneLine(
<<<SQL
CREATE TABLE "person" (
id INTEGER NOT NULL,
"title" CLOB DEFAULT NULL,
"firstName" CLOB DEFAULT NULL,
"lastName" CLOB DEFAULT NULL,
"phone" CLOB DEFAULT NULL,
"email" CLOB DEFAULT NULL,
"creditCard" INTEGER DEFAULT NULL,
"birthDay" DATETIME DEFAULT NULL,
PRIMARY KEY(id)
)
SQL
),
$this->assertRegExp(
'/CREATE TABLE "person" \(id INTEGER NOT NULL, "title" CLOB DEFAULT NULL, "firstName" CLOB DEFAULT NULL/',
$this->connection->fetchColumn("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = 'person'")
);

Expand Down Expand Up @@ -90,8 +76,8 @@ public function testCreatesATableForManyToManyReference()

self::schema($this->connection->getSchemaManager())->schemaFor($taggedPerson);

$this->assertSame(
'CREATE TABLE "person2keymarker" ("person" INTEGER DEFAULT NULL, "keymarker" VARCHAR(255) DEFAULT NULL)',
$this->assertRegExp(
'/CREATE TABLE "person2keymarker" \("person" INTEGER UNSIGNED DEFAULT NULL, "keymarker" VARCHAR\(255\) DEFAULT NULL/',
$this->connection->fetchColumn("SELECT sql FROM sqlite_master WHERE type = 'table' AND name = 'person2keymarker'")
);

Expand Down

0 comments on commit b6f21dc

Please sign in to comment.