Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Unit tests for method_exists #154

Open
ishifoev opened this issue Nov 19, 2021 · 1 comment
Open

Unit tests for method_exists #154

ishifoev opened this issue Nov 19, 2021 · 1 comment
Assignees

Comments

@ishifoev
Copy link

We have some code blocks we can't coverage test because of method exists which is false if the class is mocked.
Example

if (method_exists($node, 'getDirectoryListing')) {
			error_log("methd exists on node");
			$nodes = $node->getDirectoryListing();
			$result = array_map(function (\OCP\Files\Node $node) {
				return $this->normalizeNodeInfo($node);
			}, $nodes);
		}
		return $result;
@michielbdejong
Copy link
Member

@michielbdejong michielbdejong changed the title Unit tests for method exists Unit tests for method_exists Nov 19, 2021
@ishifoev ishifoev self-assigned this Nov 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

3 participants