/** * Test entity getters & setters */ public function testGettersSetters() { $entity = new User(); $entity->setActivationKey('activation-key'); $entity->setDisplayName('display name'); $entity->setEmail('*****@*****.**'); $entity->setLogin('login'); $collection = new ArrayCollection(); $meta1 = new UserMeta(); $meta1->setKey('meta-key'); $meta1->setValue('meta-value'); $meta1->setUser($entity); $collection->add($entity); $entity->setMetas($collection); $entity->setNicename('nice name'); $entity->setPass('pass'); $date = new \DateTime(); $entity->setRegistered($date); $entity->setStatus(2); $entity->setUrl('http://www.url.com'); $this->assertEquals('activation-key', $entity->getActivationKey()); $this->assertEquals('display name', $entity->getDisplayName()); $this->assertEquals('*****@*****.**', $entity->getEmail()); $this->assertEquals('login', $entity->getLogin()); $this->assertEquals($collection, $entity->getMetas()); $this->assertEquals('nice name', $entity->getNicename()); $this->assertEquals('pass', $entity->getPass()); $this->assertEquals($date, $entity->getRegistered()); $this->assertEquals(2, $entity->getStatus()); $this->assertEquals('http://www.url.com', $entity->getUrl()); }
/** * Test entity getters & setters */ public function testGettersSetters() { $entity = new UserMeta(); $user = new User(); $user->setDisplayName('display name'); $entity->setUser($user); $entity->setKey('fake key'); $entity->setValue('fake value'); $this->assertEquals('display name', $entity->getUser()->getDisplayName()); $this->assertEquals('fake key', $entity->getKey()); $this->assertEquals('fake value', $entity->getValue()); }
/** * Test entity getters & setters */ public function testGettersSetters() { $entity = new Comment(); $entity->setAgent('agent'); $entity->setApproved('approved'); $entity->setAuthor('author'); $entity->setAuthorEmail('*****@*****.**'); $entity->setAuthorIp('1.2.3.4'); $entity->setAuthorUrl('http://author.com'); $entity->setContent('content'); $date = new \DateTime(); $entity->setDate($date); $entity->setDateGmt($date); $entity->setKarma(2); $parent = new Comment(); $parent->setContent('parent content'); $entity->setParent($parent); $post = new Post(); $post->setTitle('post title'); $entity->setPost($post); $entity->setType('type'); $user = new User(); $user->setDisplayName('author name'); $entity->setUser($user); $this->assertEquals('agent', $entity->getAgent()); $this->assertEquals('approved', $entity->getApproved()); $this->assertEquals('author', $entity->getAuthor()); $this->assertEquals('*****@*****.**', $entity->getAuthorEmail()); $this->assertEquals('1.2.3.4', $entity->getAuthorIp()); $this->assertEquals('http://author.com', $entity->getAuthorUrl()); $this->assertEquals('content', $entity->getContent()); $this->assertEquals($date, $entity->getDate()); $this->assertEquals($date, $entity->getDateGmt()); $this->assertEquals(2, $entity->getKarma()); $this->assertEquals('parent content', $entity->getParent()->getContent()); $this->assertEquals('post title', $entity->getPost()->getTitle()); $this->assertEquals('type', $entity->getType()); $this->assertEquals('author name', $entity->getUser()->getDisplayName()); }
/** * Test entity getters & setters. */ public function testGettersSetters() { $entity = new Post(); $user = new User(); $user->setDisplayName('author name'); $entity->setAuthor($user); $entity->setCommentCount(5); $entity->setCommentStatus('approved'); $entity->setContent('post content'); $entity->setContentFiltered('post content filtered'); $date = new \DateTime(); $entity->setDate($date); $entity->setDateGmt($date); $entity->setExcerpt('excerpt'); $entity->setGuid('guid'); $entity->setMenuOrder(2); $meta1 = new PostMeta(); $meta1->setKey('meta key'); $meta1->setValue('meta value'); $meta1->setPost($entity); $collection = new ArrayCollection(); $collection->add($meta1); $entity->setMetas($collection); $entity->setMimeType('text/html'); $entity->setModified($date); $entity->setModifiedGmt($date); $entity->setName('post name'); $parent = new Post(); $parent->setTitle('parent post title'); $entity->setParent($parent); $entity->setPassword('password'); $entity->setPinged('pinged'); $entity->setPingStatus('done'); $entity->setStatus('published'); $entity->setTitle('post title'); $entity->setToPing('to ping'); $entity->setType('post type'); $this->assertEquals('author name', $entity->getAuthor()->getDisplayName()); $this->assertEquals(5, $entity->getCommentCount()); $this->assertEquals('approved', $entity->getCommentStatus()); $this->assertEquals('post content', $entity->getContent()); $this->assertEquals('post content filtered', $entity->getContentFiltered()); $this->assertEquals($date, $entity->getDate()); $this->assertEquals($date, $entity->getDateGmt()); $this->assertEquals('excerpt', $entity->getExcerpt()); $this->assertEquals('guid', $entity->getGuid()); $this->assertEquals(2, $entity->getMenuOrder()); $this->assertEquals($collection, $entity->getMetas()); $this->assertEquals('text/html', $entity->getMimeType()); $this->assertEquals($date, $entity->getModified()); $this->assertEquals($date, $entity->getModifiedGmt()); $this->assertEquals('post name', $entity->getName()); $this->assertEquals('parent post title', $entity->getParent()->getTitle()); $this->assertEquals('password', $entity->getPassword()); $this->assertEquals('pinged', $entity->getPinged()); $this->assertEquals('done', $entity->getPingStatus()); $this->assertEquals('published', $entity->getStatus()); $this->assertEquals('post title', $entity->getTitle()); $this->assertEquals('to ping', $entity->getToPing()); $this->assertEquals('post type', $entity->getType()); }