diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..189463d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,13 @@ + +# Path-based git attributes +# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html + +# Ignore all test and documentation with "export-ignore". +/.gitattributes export-ignore +/.gitignore export-ignore +/.travis.yml export-ignore +/phpunit.xml.dist export-ignore +/.scrutinizer.yml export-ignore +/tests export-ignore +/.editorconfig export-ignore +/docs export-ignore diff --git a/.gitignore b/.gitignore index ece04c9..ad9faa8 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ vendor/ composer.lock .idea .DS_Store -TODO.md \ No newline at end of file +TODO.md +.phpunit.result.cache diff --git a/.travis.yml b/.travis.yml index 86f4f0c..aba84af 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,11 @@ language: php php: - - 5.5 - 5.6 - 7.0 - 7.1 + - 7.2 + - 7.3 before_script: - composer self-update diff --git a/CHANGELOG.md b/CHANGELOG.md index 738d014..11653cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # ChangeLog +## V2.0.0 + +#### Compatibility upgrade + +Added support for Laravel 6. +Dropped support for PHP 5.5. + + ## V1.0.8 #### Fix @@ -14,6 +22,7 @@ Renamed global functions name to prevent issues when working with other packages Added OdooException in get, update and delete methods. All those methods depend on another method's result to return a correct value. + ## V1.0.6 #### New diff --git a/composer.json b/composer.json index b00e044..4608e33 100644 --- a/composer.json +++ b/composer.json @@ -20,9 +20,10 @@ }, "minimum-stability": "dev", "require": { - "illuminate/support": "^5.1" + "php": "^5.6||^7.0", + "illuminate/support": "^5.1||^6.0" }, "require-dev": { - "phpunit/phpunit": "~4.8" + "phpunit/phpunit": "~4.8||^8.0" } } diff --git a/phpunit.xml b/phpunit.xml index 15eef50..49a790f 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -7,8 +7,7 @@ convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" - stopOnFailure="false" - syntaxCheck="false"> + stopOnFailure="false"> ./tests/ diff --git a/readme.md b/readme.md index 49701de..17c1f0f 100644 --- a/readme.md +++ b/readme.md @@ -9,6 +9,12 @@ Odoo ERP API for Laravel. [Odoo website](https://www.odoo.com) [![Latest Stable Version](https://poser.pugx.org/edujugon/laradoo/v/stable)](https://packagist.org/packages/edujugon/laradoo) [![License](https://poser.pugx.org/edujugon/laradoo/license)](https://packagist.org/packages/edujugon/laradoo) +## Compatibility + +| Laravel version | PHP version | Package version | +|---|---|---| +| ^5.1 | ^5.6 | ^V2.0 | +| ^5.1 | ^5.5 | ^V1.1 | ## Installation diff --git a/tests/OdooTest.php b/tests/OdooTest.php index 3875ff8..4024f7b 100644 --- a/tests/OdooTest.php +++ b/tests/OdooTest.php @@ -1,6 +1,7 @@ host . ' db:' . $this->db . ' user:' . $this->username . ' pass:' . $this->password); $this->odoo = $this->odoo ->username($this->username) ->password($this->password) @@ -59,7 +59,7 @@ public function get_odoo_version_as_collection() { $version = $this->odoo->version(); - $this->assertInstanceOf(\Illuminate\Support\Collection::class, $version); + $this->assertInstanceOf(Collection::class, $version); } /** @test */ @@ -67,7 +67,7 @@ public function get_odoo_version_only_server_version() { $version = $this->odoo->version('server_version'); - $this->assertInternalType('string',$version); + $this->assertEquals('string', gettype($version)); } @@ -75,7 +75,7 @@ public function get_odoo_version_only_server_version() /** @test */ public function test_common_connection_odoo() { - $this->assertInternalType('integer', $this->odoo->getUid()); + $this->assertEquals('integer', gettype($this->odoo->getUid())); } @@ -96,7 +96,7 @@ public function using_search_method() ->search('res.partner'); $this->assertArrayNotHasKey('faultCode',$ids); - $this->assertInstanceOf(\Illuminate\Support\Collection::class, $ids); + $this->assertInstanceOf(Collection::class, $ids); $this->assertNotEmpty($ids); } @@ -105,7 +105,7 @@ public function count_items() { $amount = $this->odoo->count('res.partner'); - $this->assertInternalType('integer', $amount); + $this->assertEquals('integer', gettype($amount)); } /** @test */ @@ -116,7 +116,7 @@ public function get_limited_ids() ->limit(3) ->search('res.partner'); - $this->assertInstanceOf(\Illuminate\Support\Collection::class, $ids); + $this->assertInstanceOf(Collection::class, $ids); $this->assertArrayNotHasKey('faultCode',$ids); $this->assertCount(3, $ids); } @@ -132,7 +132,7 @@ public function retrieve_a_collection_only_with_field_name() $this->assertArrayNotHasKey('email',$models->first()); $this->assertArrayHasKey('name',$models->first()); - $this->assertInstanceOf(\Illuminate\Support\Collection::class, $models); + $this->assertInstanceOf(Collection::class, $models); $this->assertArrayNotHasKey('faultCode',$models); $this->assertCount(3, $models); @@ -143,7 +143,7 @@ public function get_fields_of_partner_model() { $fields = $this->odoo->fieldsOf('res.partner'); - $this->assertInstanceOf(\Illuminate\Support\Collection::class,$fields); + $this->assertInstanceOf(Collection::class, $fields); $this->assertArrayNotHasKey('faultCode',$fields); } @@ -153,7 +153,7 @@ public function create_new_record() $id = $this->odoo ->create('res.partner',['name' => 'John Odoo']); - $this->assertInternalType('integer',$id); + $this->assertEquals('integer', gettype($id)); } /** @test */ @@ -162,7 +162,7 @@ public function delete_a_record() $id = $this->odoo ->create('res.partner',['name' => 'John Odoo']); - $this->assertInternalType('integer',$id); + $this->assertEquals('integer', gettype($id)); $result = $this->odoo->deleteById('res.partner',$id); @@ -170,9 +170,9 @@ public function delete_a_record() ->where('id', $id) ->search('res.partner'); - $this->assertEmpty($ids); + $this->assertTrue($ids->isEmpty()); - $this->assertInternalType('boolean',$result); + $this->assertEquals('boolean', gettype($result)); } /** @test */ @@ -193,9 +193,9 @@ public function delete_two_record() ->where('name', 'John Odoo') ->search('res.partner'); - $this->assertEmpty($ids); + $this->assertTrue($ids->isEmpty()); - $this->assertInternalType('boolean',$result); + $this->assertEquals('boolean', gettype($result)); } /** @test */ @@ -208,7 +208,7 @@ public function delete_a_record_directly() $result = $this->odoo->where('name', 'John Odoo') ->delete('res.partner'); - $this->assertInternalType('boolean',$result); + $this->assertEquals('boolean', gettype($result)); } /** @test */