# Mock

Published articles for Mock.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Solitary or Sociable? Testing Events and Listeners using Laravel

DevFeed: [Solitary or Sociable? Testing Events and Listeners using Laravel](<https://devfeed.tech/articles/solitary-or-sociable-testing-events-and-listeners-using-laravel-39020.md>)

Original publisher: [Read original article](<https://blog.jgrossi.com/2018/solitary-or-sociable-testing-events-and-listeners-using-laravel/>)

Author: Junior Grossi

Published: 2018-04-30T03:01:07Z

Content type: tutorial

Language: en

Sources: [Junior Grossi](<https://devfeed.tech/sources/junior-grossi.md>)

Topics: [Laravel](<https://devfeed.tech/topics/laravel.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [Unit testing](<https://devfeed.tech/topics/unit-testing.md>), [PHP](<https://devfeed.tech/topics/php.md>)

Tags: [laravel](<https://devfeed.tech/tags/laravel.md>), [mock](<https://devfeed.tech/tags/mock.md>), [php](<https://devfeed.tech/tags/php.md>), [programming](<https://devfeed.tech/tags/programming.md>), [tdd](<https://devfeed.tech/tags/tdd.md>), [testing](<https://devfeed.tech/tags/testing.md>), [unit-testing](<https://devfeed.tech/tags/unit-testing.md>), [unit-tests](<https://devfeed.tech/tags/unit-tests.md>)

### AI overview

A Laravel testing tutorial about testing events and listeners, comparing solitary and sociable tests. It explains that sociable tests can become problematic when an event triggers multiple listeners because a single test may cover more than one unit or behavior.

### Source excerpt

Testing with Laravel is very easy, but it can be a nightmare when the tests depend on Events and Listeners. In this post I'm gonna show you how you can simplify and improve those tests. Laravel is one of the most popular PHP frameworks nowadays, and I'd say its Event handler is one of the ... Continue reading Solitary or Sociable? Testing Events and Listeners using Laravel

## Using Mockito's InjectMocks

DevFeed: [Using Mockito's InjectMocks](<https://devfeed.tech/articles/using-mockito-s-injectmocks-37781.md>)

Original publisher: [Read original article](<https://carlosbecker.com/posts/injectmocks/>)

Author: Carlos Alexandro Becker

Published: 2015-03-05T00:00:00Z

Content type: tutorial

Language: en

Sources: [Carlos Becker](<https://devfeed.tech/sources/carlos-becker.md>)

Topics: [Testing](<https://devfeed.tech/topics/testing.md>), [Java](<https://devfeed.tech/topics/java.md>)

Tags: [java](<https://devfeed.tech/tags/java.md>), [mock](<https://devfeed.tech/tags/mock.md>), [mockito](<https://devfeed.tech/tags/mockito.md>), [test](<https://devfeed.tech/tags/test.md>), [testing](<https://devfeed.tech/tags/testing.md>), [using](<https://devfeed.tech/tags/using.md>)

### AI overview

A quick Java testing tip that demonstrates how Mockito's @InjectMocks can inject mocked dependencies into a class under test, avoiding manual constructor calls. The article notes that the annotation has limitations but works for most cases.

### Source excerpt

FYI: Like the previous post, this is a really quick tip.

## Screencast: Using Pretender to mock a server with Ember.js

DevFeed: [Screencast: Using Pretender to mock a server with Ember.js](<https://devfeed.tech/articles/screencast-using-pretender-to-mock-a-server-with-ember-js-40632.md>)

Original publisher: [Read original article](<https://eviltrout.com/blog/2014-08-26-pretender/>)

Published: 2014-08-26T00:00:00Z

Content type: tutorial

Language: en

Sources: [Robin Ward](<https://devfeed.tech/sources/robin-ward.md>)

Topics: [Ember](<https://devfeed.tech/topics/ember.md>), [JavaScript](<https://devfeed.tech/topics/javascript.md>), [test](<https://devfeed.tech/topics/test.md>), [Library](<https://devfeed.tech/topics/library.md>), [GitHub](<https://devfeed.tech/topics/github.md>)

Tags: [branch](<https://devfeed.tech/tags/branch.md>), [ember](<https://devfeed.tech/tags/ember.md>), [integration-test](<https://devfeed.tech/tags/integration-test.md>), [javascript](<https://devfeed.tech/tags/javascript.md>), [js](<https://devfeed.tech/tags/js.md>), [library](<https://devfeed.tech/tags/library.md>), [login](<https://devfeed.tech/tags/login.md>), [mock](<https://devfeed.tech/tags/mock.md>)

### AI overview

A screencast demonstrates how to use Pretender, a JavaScript mock server library, in an Ember.js integration test. The source code for the login application is available on GitHub, with the finished version in the pretender branch.

### Source excerpt

Recently I fell in love with Pretender, the mock server library in Javascript, so I decided to record a screencast showing how to use it in an Ember.js integration test: The source code for the login application is on github. The finished version is in the pretender branch.