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

chore: fix example test code for appstarter and module #5421

Merged
merged 1 commit into from
Dec 3, 2021

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Dec 1, 2021

Description

  • fix example test code for starter and module

Right after installing CI4, tests fail:

$ composer create-project codeigniter4/appstarter ci4
$ cd ci4
$ composer test
> phpunit
PHPUnit 9.5.10 by Sebastian Bergmann and contributors.

FEE..                                                               5 / 5 (100%)

Time: 00:00.584, Memory: 26.00 MB

There were 2 errors:

1) ExampleDatabaseTest::testSoftDeleteLeavesRow
ErrorException: Attempt to read property "id" on null

/Users/kenji/tmp/ci4/tests/database/ExampleDatabaseTest.php:32

2) ExampleSessionTest::testSessionSimple
Error: Call to a member function set() on array

/Users/kenji/tmp/ci4/tests/session/ExampleSessionTest.php:12

--

There was 1 failure:

1) ExampleDatabaseTest::testModelFindAll
Failed asserting that actual size 0 matches expected size 3.

/Users/kenji/tmp/ci4/tests/database/ExampleDatabaseTest.php:22

ERRORS!
Tests: 5, Assertions: 3, Errors: 2, Failures: 1.

Generating code coverage report in Clover XML format ... done [00:00.180]

Generating code coverage report in HTML format ... done [00:00.184]

Generating code coverage report in PHP format ... done [00:00.001]


Code Coverage Report:   
  2021-12-01 05:37:22   
                        
 Summary:               
  Classes: 20.00% (1/5) 
  Methods: 16.67% (1/6) 
  Lines:   20.93% (9/43)

Config\Database
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  4/  4)
Script phpunit handling the test event returned with error code 2

Checklist:

  • Securely signed commits
  • [] Component(s) with PHPDoc blocks, only if necessary or adds value
  • [] Unit testing, with >80% coverage
  • [] User guide updated
  • Conforms to style guide

@kenjis kenjis added the bug Verified issues on the current code behavior or pull requests that will fix them label Dec 1, 2021
@kenjis kenjis changed the title chore: fix example test code for starter and module chore: fix example test code for appstarter and module Dec 1, 2021
@kenjis kenjis force-pushed the fix-starter-tests branch from c08dbaa to 027381d Compare December 2, 2021 02:27
@paulbalandan paulbalandan merged commit 3432a9a into codeigniter4:develop Dec 3, 2021
@kenjis kenjis deleted the fix-starter-tests branch December 3, 2021 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants