/** * Bootstrap the application events. * * @return void */ public function boot() { $this->package('muratsplat/multilang'); // adding new rules for our extention $this->addNewRules(); // setting laravel events object MultiLang::setEventDispatcher($this->app['events']); }
public function testMultilangAndWrapperIssueOfMakedBeEmptySelf() { $mockedConfig = $this->getMockedConfig(); $mockedConfig->shouldReceive('get')->with('multilang::prefix')->andReturn('@'); $mockedConfig->shouldReceive('get')->with('multilang::reservedAttribute')->andReturn('__lang_id__'); $messageBag = $this->getMockedMessageBag(); $validator = $this->getMockedValid(); $mockedConfig->shouldReceive('get')->andReturn('Lang'); $validator->shouldReceive('make')->andReturn(true); $multiLang = new MultiLang(new Picker(new Collection(), new Element(), $mockedConfig), $mockedConfig, $messageBag, $validator, new Wrapper($mockedConfig, $this->getCheckerAttribute(), $this->app['cache.store']), $this->app['cache.store']); $this->createContentWithLanguages(); $collection = Content::all(); $count = $collection->count(); $wrapperCollection = $multiLang->makeWrapper($collection, 2, 1); $this->assertInstanceOf('Illuminate\\Support\\Collection', $wrapperCollection); foreach ($wrapperCollection as $v) { $v->enable; $v->visible; $v->title; $v->content; } // fixed !!! $this->assertCount($count, $collection); // Collection is empty by self!! }