• Stars
    star
    83
  • Rank 378,843 (Top 8 %)
  • Language
    PHP
  • License
    MIT License
  • Created almost 5 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ„โ€โ™‚๏ธ Allows mocking final classes in PHP.

Mock final classes example

Build Status Total Downloads Latest Version License

Created by, and is maintained by Nuno Maduro, and once installed it automatically allows mocking of final methods and classes.

๐Ÿ’ก Installation & Usage

Requires PHP 7.1+

First, install the package using Composer:

composer require --dev nunomaduro/mock-final-classes

That's it! You can now mock final methods and classes. ๐Ÿ„โ€โ™‚๏ธ

๐Ÿคฏ How it works?

  1. First, we run the file autoload.php using Composer Autoload.
  2. Then, we determine if you are running a supported test framework
  3. Then, we use the library dg/bypass-finals to remove final keywords from source code on-the-fly: https://github.com/nunomaduro/mock-final-classes/src/Runner.php#L31.

๐Ÿ‘๐Ÿป Credits

Most of the work is done by the library dg/bypass-finals, so make sure you support the maintainer here: Donate. Thank you!


Mock Final Classes is an open-sourced software licensed under the MIT license.

More Repositories

1

phpinsights

๐Ÿ”ฐ Instant PHP quality checks from your console
PHP
5,176
star
2

larastan

โš—๏ธ Adds code analysis to Laravel improving developer productivity and code quality.
PHP
4,882
star
3

collision

๐Ÿ’ฅ Collision is a beautiful error reporting tool for command-line applications
PHP
4,429
star
4

termwind

๐Ÿƒ In short, it's like Tailwind CSS, but for the PHP command-line applications.
PHP
2,151
star
5

laravel-console-menu

๐Ÿ”˜ Beautiful PHP CLI menus. Is a php-school/cli-menu wrapper for Laravel/Artisan Console Commands
PHP
794
star
6

skeleton-php

โšก๏ธ This package provides a wonderful PHP skeleton to start building your next package idea.
PHP
647
star
7

laravel-desktop-notifier

๐Ÿ’ป Send notifications to your desktop from your Laravel Artisan Commands. An JoliNotif wrapper for Laravel.
PHP
415
star
8

laravel-mojito

๐Ÿน A lightweight package for testing Laravel views in isolation
PHP
372
star
9

pest

This repository contains an old version of PEST. A new and better version is being coded in private and will be out soon: https://github.com/pestphp/pest.
342
star
10

patrol

Patrol is an elegant command-line tool that keeps your PHP Project's dependencies in check.
PHP
256
star
11

laravel-console-task

โœ… Laravel Console Task is a output method for Laravel Console Commands.
PHP
252
star
12

awesome-php-src

๐Ÿš€ A curated list of awesome resources related to PHP source code
224
star
13

curryable

An elegant and simple curry(f) implementation in PHP.
PHP
175
star
14

dd

โœจ The most popular way of debugging in PHP is now available in JavaScript.
JavaScript
159
star
15

yorn

โš—๏ธ Modules in PHP with the `import` and `export` syntax
PHP
146
star
16

laravel-console-dusk

Laravel Console Dusk allows the usage of Laravel Dusk in Laravel/Laravel Zero artisan commands.
PHP
144
star
17

laracon-schedule

๐Ÿ‘จ๐Ÿปโ€๐Ÿš€ A command-line tool that gives you the @LaraconOnline schedule in your timezone. ๐Ÿš€
PHP
101
star
18

laravel-pot

Provides Artisan commands to inspect Laravel Application's container. ๐Ÿชด
PHP
88
star
19

awesome-laravel-vapor

๐Ÿš€ A curated list of awesome resources related to Laravel Vapor.
80
star
20

laravel-console-summary

๐Ÿ“– Beautiful Laravel Console Summary for Artisan or Laravel Zero.
PHP
62
star
21

collision-adapter-symfony

Collision's adapter for Symfony applications. Error Reporting for console/command-line PHP applications.
PHP
45
star
22

dig

๐Ÿ‘จ๐Ÿปโ€๐ŸŽจ A beautiful debug tool for the command line.
PHP
40
star
23

laravel-any

๐Ÿ“ Laravel collection macro that determine if `any` item from the collection passes the given truth test.
PHP
38
star
24

nunomaduro.com

Rust
34
star
25

skeleton-c

โšก๏ธ This package provides a wonderful C skeleton to start building your next package idea.
Makefile
33
star
26

php-interminal

PHP Interminal is a command-line tool that gives you access to PHP Internals discussions in your terminal.
PHP
32
star
27

bombe

Bombe is a tool for benchmarking the given url response status and response time.
C
23
star
28

skeleton-js

๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป A skeleton repository for my open source JavaScript packages
JavaScript
21
star
29

elegant-sublime

๐Ÿ‘”An collection of sublime text preferences
17
star
30

pint-strict-preset

Pint strict preset is an insanely defensive coding style preset for those who demand meticulous precision in their projects.
11
star
31

alpine-day-schedule

๐Ÿ‘จ๐Ÿปโ€๐Ÿš€ A command-line tool that gives you the Alpine Day 2021 schedule in your timezone. ๐Ÿš€
PHP
11
star
32

talks

๐ŸŽค My talks about PHP, Laravel or side projects of mine
10
star
33

laravel-meetups

๐Ÿ•It's Meetup time! Find out Laravel Meetups near you!
PHP
8
star
34

laravel-console-spinner

โƒ A spinning activity indicator for Laravel/Laravel Zero artisan commands.
7
star
35

laravel-9-test

PHP
5
star
36

forge-octane

PHP
5
star
37

scout-extended-demo

PHP
3
star
38

skeleton-typescript

โš—๏ธ The perfect starting for typescript libraries.
3
star
39

laravel-zero-weather

PHP
3
star
40

nextjs-blog-wqdqwdqwd

JavaScript
2
star
41

dotfiles

2
star
42

twitter-stream

An demo application of Laravel Zero that works with the Twitter Streaming API
PHP
2
star
43

learn-javascript

2
star
44

laravel-datatables

jQuery DataTables API for Laravel 4|5
PHP
1
star
45

phpunit-snapshot-assertions

A way to test without writing actual testย cases
PHP
1
star
46

my-site

HTML
1
star
47

vapor-github-test

PHP
1
star
48

qwdpowkqdopwqkd

JavaScript
1
star
49

skeleton-php-1

My PHP Package Skeleton
PHP
1
star
50

exclude-dev-files-bug

PHP
1
star
51

kpop-stack

TypeScript
1
star
52

nunomaduro

1
star
53

helpers-tap

๐Ÿšฐ Tap that method
TypeScript
1
star
54

test

HTML
1
star
55

perna

๐Ÿ›‹ Optimises the workflow around managing multi-package repositories.
1
star
56

laravel-collections-examples

PHP
1
star
57

demo-p

PHP
1
star