Comments (1)
And PHPunit for some reason considers these both to be equal, for some reason I have no idea.
I know it's been a long time since this issue was open. But just to clarify that PHPUnit's interpretation is not wrong here.
It's interpreting the assertion correctly, 26213400
is a truthy value in PHP. Therefore assetEquals
will return true
since a truthy value is equal to true in PHP. Using assertSame
will fail however since the expectation and the actual value aren't of the same type, they are both truthy but one is an int
and the other is a boolean
.
Boiled down, PHPUnit's assertEquals
is a non-strict equality check in PHP (==
), assertSame
would be a strict equality check (===
).
This can be seen if you try and write it out the checks yourself in plain PHP, as demonstrated here.
var_dump(26213400 == true); // true
var_dump(26213400 === true); // false
from google2fa.
Related Issues (20)
- verifyKeyNewer() not working as expected HOT 5
- Not working with Laravel API HOT 1
- How to force the user to using 2FA
- Bug in testing (not a security issue)
- Don't ask for 2FA code every time HOT 3
- Google Authenticator and Authy App generating invalid codes HOT 1
- verifyKey always fail - simple demo HOT 1
- Is it possible to add enable 2FA using this library via a code (i.e. not using a QR code)? HOT 1
- (Old) Demo page is broken
- composer error: The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems) Unzip with 7z command failed, falling back to ZipArchive class
- Anyone know how to deeplink open authenticator app from iOS
- verifyKeyNewer HOT 1
- Is it possible to install directly in FTP directory, ie. without using composer? HOT 1
- Secret key is too short. Must be at least 16 base32 characters
- Typo in a code of the Google2FA class on line 397 (8.x - php 7.4) HOT 1
- Code timing incorrect HOT 2
- libxml extention error HOT 1
- QRCode URL shows 404 HOT 8
- broken img link on google2fa qrcode HOT 1
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 google2fa.