public function testPersist() { $this->storage->expects($this->once())->method('updateAvatar'); $this->repository->expects($this->exactly(2))->method('persist'); $user = new Netizen(new Author('kirk')); $user->setProfile(new Profile()); $this->sut->persist($user); return $user; }
public function testSendToFollower() { $current = $this->repo->findByNickname('kirk'); $follower = $this->repo->findByNickname('spock'); $follower->follow($current); $this->repo->persist($current); $this->repo->persist($follower); $randomMsg = "Scanning" . rand(); $crawler = $this->getPage('private_create', ['author' => 'spock']); $form = $crawler->filter('.pm-form')->selectButton('Send')->form(); $crawler = $this->client->submit($form, ['social_private_message' => ['message' => $randomMsg]]); $this->assertCount(1, $crawler->filter("div.pm-sent:contains('spock')")); $this->assertCount(1, $crawler->filter("div.pm-sent:contains('{$randomMsg}')")); return $randomMsg; }