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

Fix unit test function name so that test runs (and fails) #121

Open
phil-davis opened this issue Apr 2, 2019 · 3 comments
Open

Fix unit test function name so that test runs (and fails) #121

phil-davis opened this issue Apr 2, 2019 · 3 comments
Labels

Comments

@phil-davis
Copy link
Contributor

Steps to reproduce

  1. fix https://github.com/owncloud/announcementcenter/pull/20/files#diff-1879b41e5a6d3340aeaa60e56c81373fR167
    public function te1stAnnouncement() => public function testAnnouncement()
  2. make test-php-unit

Expected behaviour

Unit tests pass

Actual behaviour

make test-php-unit
composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
php -d zend.enable_gc=0 "/home/phil/git/owncloud/core/apps-external/announcementcenter/../../lib/composer/bin/phpunit" --configuration ./phpunit.xml --testsuite unit
PHPUnit 6.5.14 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.2.16-1+ubuntu18.04.1+deb.sury.org+1 with Xdebug 2.7.0
Configuration: /home/phil/git/owncloud/core/apps-external/announcementcenter/phpunit.xml

............................................................F     61 / 61 (100%)

Time: 1.61 seconds, Memory: 22.00MB

There was 1 failure:

1) OCA\AnnouncementCenter\Tests\Unit\Notification\NotifierTest::testAnnouncement
Failed asserting that null is of type "int".

/home/phil/git/owncloud/core/apps-external/announcementcenter/tests/Unit/Notification/NotifierTest.php:197

FAILURES!
Tests: 61, Assertions: 140, Failures: 1.

Generating code coverage report in Clover XML format ... done
Makefile:108: recipe for target 'test-php-unit' failed
make: *** [test-php-unit] Error 1

Note: before fixing the function name, only 60 tests are running. Test 61 has not been running.

Server configuration

git clone development environment or drone

@phil-davis phil-davis added the bug label Apr 2, 2019
@phil-davis
Copy link
Contributor Author

@PVince81 how many more unit tests do we have with that do not run because of typos like this?

The original PR #20 was merged with no review.

@PVince81
Copy link
Contributor

PVince81 commented Apr 2, 2019

I can't believe this would be a legit typo... maybe he just wanted to temporarily disable the test. I usually rename "test" to "xtest" to disable tests...

this app used to be a bit of a "side project" back at the time which is why there were no reviews...

@phil-davis
Copy link
Contributor Author

@PVince81 @micbar I came across this again just now when being asked about announcement centre tests.
At https://github.com/owncloud/announcementcenter/blob/master/tests/Unit/Notification/NotifierTest.php#L196 $announcement is NULL but $this->manager->announce() has code to return an array, so something odd is going on.
Should someone look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants