Mockery VS casbin

Compare Mockery vs casbin and see what are their differences.

Mockery

Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). (by mockery)

casbin

An authorization library that supports access control models like ACL, RBAC, ABAC in Golang: https://discord.gg/S5UjpzGZjN (by casbin)
Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
Mockery casbin
3 38
10,558 16,865
0.2% 1.7%
9.5 7.2
3 days ago 19 days ago
PHP Go
BSD 3-clause "New" or "Revised" License Apache License 2.0
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

Mockery

Posts with mentions or reviews of Mockery. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-12-20.
  • I share my authentication server.
    18 projects | /r/golang | 20 Dec 2021
    Continuous Integration - Testify, sqlmock, Mockery, Github Actions
  • Test doubles
    3 projects | dev.to | 18 Mar 2021
    Mockery is another framework for creating test doubles. It can be used with PHPUnit, phpspec, Behat, or any other testing framework. I find it especially powerful when working with legacy code, due to its support for creating partial mocks or mocking hard dependencies.
  • Testing with immutable PSR-7 objects and Prophecy
    3 projects | dev.to | 4 Mar 2021
    This works great if a method is tested that modifies and returns an object; we'll get an instance of that object and we are able to run all sorts of assertions on it. But what if this is not the case. What if we have a situation where a value object is passed as a parameter, some modifications are done and the value object is passed to another object. Something like the middleware from the example earlier. Some testing frameworks like Mockery offer spies to test these situations. When using Prophecy this situation can be handled using Argument::that():

casbin

Posts with mentions or reviews of casbin. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-11-07.

What are some alternatives?

When comparing Mockery and casbin you can also consider the following projects:

Prophecy - Highly opinionated mocking framework for PHP 5.3+

OPA (Open Policy Agent) - Open Policy Agent (OPA) is an open source, general-purpose policy engine.

PHPUnit - The PHP Unit Testing framework.

casdoor - An open-source UI-first Identity and Access Management (IAM) / Single-Sign-On (SSO) platform with web UI supporting OAuth 2.0, OIDC, SAML, CAS, LDAP, SCIM, WebAuthn, TOTP, MFA and RADIUS [Moved to: https://github.com/casdoor/casdoor]

Faker

Ory Keto - Open Source (Go) implementation of "Zanzibar: Google's Consistent, Global Authorization System". Ships gRPC, REST APIs, newSQL, and an easy and granular permission language. Supports ACL, RBAC, and other access models.

AspectMock - The most powerful and flexible mocking framework for PHPUnit / Codeception.

CASL - CASL is an isomorphic authorization JavaScript library which restricts what resources a given user is allowed to access

Phake - PHP Mocking Framework

zanzibar - A build system & configuration system to generate versioned API gateways.

Codeception - Full-stack testing PHP framework

jwt-auth - This package provides json web token (jwt) middleware for goLang http servers