30 protected $testExtensionsToLoad = array(
'typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example');
54 $this->persistentManager = $this->objectManager->get(
'TYPO3\\CMS\\Extbase\\Persistence\\Generic\\PersistenceManager');
55 $this->blogRepository = $this->objectManager->get(
'ExtbaseTeam\\BlogExample\\Domain\\Repository\\BlogRepository');
61 public function addSimpleObjectTest() {
62 $newBlogTitle =
'aDi1oogh';
63 $newBlog = $this->objectManager->get(
'ExtbaseTeam\\BlogExample\\Domain\\Model\\Blog');
64 $newBlog->setTitle($newBlogTitle);
67 $this->blogRepository->add($newBlog);
68 $this->persistentManager->persistAll();
70 $newBlogCount = $this->
getDatabaseConnection()->exec_SELECTcountRows(
'*',
'tx_blogexample_domain_model_blog',
'title = \'' . $newBlogTitle .
'\'');
71 $this->assertSame(1, $newBlogCount);
77 public function addObjectSetsDefaultLanguageTest() {
78 $newBlogTitle =
'aDi1oogh';
79 $newBlog = $this->objectManager->get(
'ExtbaseTeam\\BlogExample\\Domain\\Model\\Blog');
80 $newBlog->setTitle($newBlogTitle);
83 $this->blogRepository->add($newBlog);
84 $this->persistentManager->persistAll();
86 $newBlogRecord = $this->
getDatabaseConnection()->exec_SELECTgetSingleRow(
'*',
'tx_blogexample_domain_model_blog',
'title = \'' . $newBlogTitle .
'\'');
87 $this->assertEquals(0, $newBlogRecord[
'sys_language_uid']);
93 public function addObjectSetsDefinedLanguageTest() {
94 $newBlogTitle =
'aDi1oogh';
95 $newBlog = $this->objectManager->get(
'ExtbaseTeam\\BlogExample\\Domain\\Model\\Blog');
96 $newBlog->setTitle($newBlogTitle);
97 $newBlog->_setProperty(
'_languageUid', -1);
100 $this->blogRepository->add($newBlog);
101 $this->persistentManager->persistAll();
103 $newBlogRecord = $this->
getDatabaseConnection()->exec_SELECTgetSingleRow(
'*',
'tx_blogexample_domain_model_blog',
'title = \'' . $newBlogTitle .
'\'');
104 $this->assertEquals(-1, $newBlogRecord[
'sys_language_uid']);
static makeInstance($className)