Comments (8)
Try with phpunit tests/Api/ --bootstrap vendor/autoload.php
. Let me know if it doesn't work.
from php-last.fm-api.
I am using WAMP / Windows.
How exactly should i exactly that?
from php-last.fm-api.
I presume you have phpunit installed. If not, you can install it with composer composer global require "phpunit/phpunit=5.1.*"
Then open a cmd and run phpunit tests/Api/ --bootstrap vendor/autoload.php
from the root of the project.
from php-last.fm-api.
Yeah, installed it now. thanks.
It writes:
Deprecated: The each() function is deprecated. This message will be suppressed on further calls in C:\Users\User\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\Util\Getopt.php on line 38
Fatal error: Uncaught You must provide a valid api key, api secret, session key and username to test this method!
C:\wamp64\www\PHP-Last.fm-API-master\tests\Api\BaseAuthenticatedApiTest.php:26
C:\wamp64\www\PHP-Last.fm-API-master\tests\Api\AuthenticatedTrackTest.php:22
C:\Users\User\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\TextUI\Command.php:128
C:\Users\User\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\TextUI\Command.php:106
I did provide .env file inside tests/Api/, however, i did not fill:
lastfm_token=
lastfm_session_key=
from php-last.fm-api.
Fill them with a random string then. All test will pass, except for those that need last.fm token and session key. You should pass around 90% of tests.
from php-last.fm-api.
Hey,
I filled token and session with random keys.
I thought i can run tests directly in browsers . Quite new to this methods.
Here is what i get: (i guess some passed):
.........E.......EEEE.............................. 51 / 51 (100%)
Time: 29.36 seconds, Memory: 6.00MB
There were 5 errors:
- Tests\Api\ArtistTest::testSimilar
Error: Cannot use string offset as an arrayC:\wamp64\www\PHP-Last.fm-API-master\src\lastfmapi\Api\ArtistApi.php:262
C:\wamp64\www\PHP-Last.fm-API-master\tests\Api\ArtistTest.php:69
C:\Users\User\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\TextUI\Command.php:155
C:\Users\User\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\TextUI\Command.php:106
- Tests\Api\AuthenticatedTrackTest::testLoveTrack
LastFmApi\Exception\ApiFailedException: Invalid session key - Please re-authenticateC:\wamp64\www\PHP-Last.fm-API-master\src\lastfmapi\Api\BaseApi.php:187
C:\wamp64\www\PHP-Last.fm-API-master\src\lastfmapi\Api\BaseApi.php:261
C:\wamp64\www\PHP-Last.fm-API-master\src\lastfmapi\Api\TrackApi.php:346
C:\wamp64\www\PHP-Last.fm-API-master\tests\Api\AuthenticatedTrackTest.php:32
C:\Users\User\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\TextUI\Command.php:155
C:\Users\User\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\TextUI\Command.php:106
- Tests\Api\AuthenticatedTrackTest::testUnloveTrack
LastFmApi\Exception\ApiFailedException: Invalid session key - Please re-authenticateC:\wamp64\www\PHP-Last.fm-API-master\src\lastfmapi\Api\BaseApi.php:187
C:\wamp64\www\PHP-Last.fm-API-master\src\lastfmapi\Api\BaseApi.php:261
C:\wamp64\www\PHP-Last.fm-API-master\src\lastfmapi\Api\TrackApi.php:381
C:\wamp64\www\PHP-Last.fm-API-master\tests\Api\AuthenticatedTrackTest.php:42
C:\Users\User\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\TextUI\Command.php:155
C:\Users\User\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\TextUI\Command.php:106
- Tests\Api\AuthenticatedTrackTest::testScrobbleASingleTrack
LastFmApi\Exception\ApiFailedException: Invalid session key - Please re-authenticateC:\wamp64\www\PHP-Last.fm-API-master\src\lastfmapi\Api\BaseApi.php:187
C:\wamp64\www\PHP-Last.fm-API-master\src\lastfmapi\Api\BaseApi.php:261
C:\wamp64\www\PHP-Last.fm-API-master\src\lastfmapi\Api\TrackApi.php:561
C:\wamp64\www\PHP-Last.fm-API-master\tests\Api\AuthenticatedTrackTest.php:53
C:\Users\User\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\TextUI\Command.php:155
C:\Users\User\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\TextUI\Command.php:106
- Tests\Api\AuthenticatedTrackTest::testScrobbleABatchOfTracks
LastFmApi\Exception\ApiFailedException: Invalid session key - Please re-authenticateC:\wamp64\www\PHP-Last.fm-API-master\src\lastfmapi\Api\BaseApi.php:187
C:\wamp64\www\PHP-Last.fm-API-master\src\lastfmapi\Api\BaseApi.php:261
C:\wamp64\www\PHP-Last.fm-API-master\src\lastfmapi\Api\TrackApi.php:561
C:\wamp64\www\PHP-Last.fm-API-master\tests\Api\AuthenticatedTrackTest.php:71
C:\Users\User\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\TextUI\Command.php:155
C:\Users\User\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\TextUI\Command.php:106Fatal error: Uncaught Error: Call to undefined method PHPUnit_Framework_TestResult::warningCount() in C:\Users\User\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\TextUI\ResultPrinter.php:185
Stack trace:
#0 C:\wamp64\www\PHP-Last.fm-API-master\vendor\phpunit\phpunit\src\TextUI\TestRunner.php(446): PHPUnit_TextUI_ResultPrinter->printResult(Object(PHPUnit_Framework_TestResult))
#1 C:\Users\User\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\TextUI\Command.php(155): PHPUnit_TextUI_TestRunner->doRun(NULL, Array)
#2 C:\Users\User\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\TextUI\Command.php(106): PHPUnit_TextUI_Command->run(Array, true)
#3 C:\Users\User\AppData\Roaming\Composer\vendor\phpunit\phpunit\phpunit(47): PHPUnit_TextUI_Command::main()
#4 {main}
thrown in C:\Users\User\AppData\Roaming\Composer\vendor\phpunit\phpunit\src\TextUI\ResultPrinter.php on line 185
from php-last.fm-api.
Yes, 46 of 51 passed. 5 failed (those that need the token or session key).
from php-last.fm-api.
Thanks.
from php-last.fm-api.
Related Issues (17)
- Can not get playlist.fetch working HOT 9
- album.php getInfo() does not assign tracks to the return variable $info HOT 2
- Notice: Undefined offset: 0 - lastfmapi/class/apibase.php (110) HOT 4
- Missing method 'getImages' in artist.php HOT 3
- Dependency Injection HOT 2
- Link is broken HOT 4
- Undefined method AuthApi::apiSig() in AuthApi->getToken() HOT 4
- Throw Exceptions instead of calling handleError() HOT 1
- Auth not working HOT 7
- TrackApi has no 'unlove' method HOT 2
- composer install not passing without api key in .env HOT 2
- cannot manage to make it scrobble HOT 2
- Cannot use string offset as an array in php
- Method track.scrobble HOT 1
- Hi, how can I check that the user is successully logged ? HOT 1
- Adding limit to getLovedTracks does not work HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-last.fm-api.