Comments (3)
The reason is that you don't access the enum in your test method but the data provider. These are executed outside the normal context (possibly even a different process) why you can't use things like Laravel/Symfony Container or other more complex dependencies in them.
That's why xDebug doesn't see the call to the enum methods.
One way to solve it would be to pass the method name as string from the data provider and call ReadingContext::from($name)
in your test method. That way you should get a proper coverage report.
Another thing: we will proceed the package even after PHP8.1 (see #96) - as the native enums are a massive improvement but we want to keep some of the current methods/features and also need them for the Laravel Wrapper.
So just to let you know - it's up to you how you want to switch. 😉
from enum.
yes, it works fine now. Thanks for explanation!
I'm writing framework agnostic package and in 8.1 planning to move to built-in enums because enums in my package never wouldn't change and right now spatie/enum
is just single dependency and it would be better without any of dependencies. But maybe will leave this package, I will see later at autumn.
Many thanks for quick response and your work! Appreciated
from enum.
The new version will integrate with native enums. So you will use enum ReadingContext
but have methods like the values()
, labels()
and equals()
on it.
If you don't need these things or think that you don't need the package for it - totally fine! 👍
Just wanted to let you know that we won't abandon that package but bring it to the next level.^^
from enum.
Related Issues (20)
- Enum serialized as empty array when using spatie/laravel-event-sourcing and spatie/data-transfer-object HOT 3
- Doc link is broken HOT 2
- Strong typed enums problems HOT 2
- Enums with Laravel Octane HOT 2
- initialize Enum with values coming from DB? HOT 2
- PHPUnit assertions trait changed to class HOT 6
- Too few arguments to function Spatie\Enum\Enum::__construct(), 0 passed HOT 3
- OPcache strip comments problem HOT 2
- Missing documentation for ->isXy() HOT 1
- Deprecate values HOT 1
- Localised labels aren't update after locale is changed HOT 2
- can php7.2 (or even 7.3) be supported? HOT 2
- Extend already extended HOT 2
- Creating enum using method call from within enum throws UnknownEnumMethod HOT 6
- Consider using generics for better IDE support HOT 8
- Future of this package after PHP 8.1 HOT 7
- Support standard strict comparison HOT 5
- PHP8.1 Compatibility: check properties HOT 1
- Fix "Creating an enum from a value" example in documentation HOT 2
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 enum.