This patch automatically restricts the code coverage score to the current library. By default, atoum can exclude some namespaces, but we want to exclude all namespaces except the current tested one. To achieve this, we create a new coverage score, which extends the default atoum\score\coverage class. The isExcluded method is extended to support the restrictedNamespace attribute.
The restrictNamespace method is also new. It adds a namespace separator (backslash) at the end of the restrictedNamepace to avoid a prefix collision. For instance: Foo\Bar will not collide withFoo\Barz if we test the latter starts with Foo\Bar\.
If the namespace is not excluded, we re-use the parent isExcluded method to get all the default features from atoum.
On Hoa\Acl, the code coverage was reporting scores for Hoa\Acl and Hoa\Exception. With this patch, it reports scores only for Hoa\Acl, which is the expected behavior in our case.
This patch automatically restricts the code coverage score to the current library. By default, atoum can exclude some namespaces, but we want to exclude all namespaces except the current tested one. To achieve this, we create a new coverage score, which extends the default
atoum\score\coverage
class. TheisExcluded
method is extended to support therestrictedNamespace
attribute.The
restrictNamespace
method is also new. It adds a namespace separator (backslash) at the end of therestrictedNamepace
to avoid a prefix collision. For instance:Foo\Bar
will not collide withFoo\Barz
if we test the latter starts withFoo\Bar\
.If the namespace is not excluded, we re-use the parent
isExcluded
method to get all the default features from atoum.On
Hoa\Acl
, the code coverage was reporting scores forHoa\Acl
andHoa\Exception
. With this patch, it reports scores only forHoa\Acl
, which is the expected behavior in our case.Address https://github.com/hoaproject/Acl/pull/20.