Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
This package has been abandoned.
Generated on May 10, 2024 via composer

phpunit/phpunit-mock-objects 5.0.10

Mock Object library for PHPUnit
Package summary
Share
1
issue
1
high severity
meta
1
2
licenses
4
BSD-3-Clause
1
MIT
Package created
18 Sep 2012
Version published
9 Aug 2018
Maintainers
1
Total deps
5
Direct deps
3
License
BSD-3-Clause

Issues

1

1 high severity issue

high
via: phpunit/phpunit-mock-objects@5.0.10
Collapse
Expand

Licenses

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
4 Packages, Including:
phpunit/php-text-template@1.2.1
phpunit/phpunit-mock-objects@5.0.10
sebastian/exporter@3.1.6
sebastian/recursion-context@3.0.2

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
doctrine/instantiator@1.5.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

3
All Dependencies CSV
β“˜ This is a list of phpunit/phpunit-mock-objects 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
doctrine/instantiator1.5.0-MIT
prod
phpunit/php-text-template1.2.13.86 kBBSD-3-Clause
prod
sebastian/exporter3.1.6-BSD-3-Clause
prod

Visualizations

Frequently Asked Questions

What does phpunit/phpunit-mock-objects do?

PHPUnit's Mock Object Library, also known as phpunit/phpunit-mock-objects, is a built-in feature that contributes significantly to PHPUnit's core functionality. Its chief role is to generate mock objects to assist developers in carrying out unit tests. This adds a layer of abstraction to the testing process, simulating the behaviour of real objects in a controlled way. The library aids in avoiding any unexpected side effects or external dependencies that might otherwise appear when using real objects.

How do you use phpunit/phpunit-mock-objects?

The phpunit-mock-objects library is used extensively within PHPUnit to create mock, stub, or dummy objects for testing purposes. With this library, you can easily mock specific methods of your classes and set precise return values or expected invocations. For instance, if you have a class named SampleClass and you want to mock it, your code would look like this:

$mock = $this->getMockBuilder('SampleClass')
             ->setMethods(['method1', 'method2'])
             ->getMock();

$mock->method('method1')
     ->willReturn('Return value of method1');

$mock->expects($this->any())
     ->method('method2')
     ->will($this->returnValue('Return value of method2'));

In this example, $mock is a mocked object of SampleClass. The methods method1 and method2 are being mocked where 'method1' will always return 'Return value of method1' and 'method2' will return 'Return value of method2' when called any number of times.

Where are the phpunit/phpunit-mock-objects docs?

The phpunit-mock-objects package does not have dedicated docs; however, comprehensive documentation about Mock Objects can be found directly within the PHPUnit manual. Users can explore the PHPUnit manual at PHPUnit.de, which offers detailed explanations and examples on how to create and use mock objects in PHPUnit.