Contains common import logic
Автор: Bob Olde Hampsink (b.oldehampsink@itmundi.nl)
Наследование: extends craft\BaseApplicationComponent
Пример #1
0
 /**
  * @covers ::slugify
  */
 public function testSlugifyShouldSlugifyString()
 {
     $string = 'Test string';
     $slug = 'test-string';
     $mockConfigService = $this->getMock('Craft\\ConfigService');
     $mockConfigService->expects($this->any())->method('get')->willReturnCallback(function ($option) {
         if ($option == 'allowUppercaseInSlug') {
             return false;
         } elseif ($option == 'slugWordSeparator') {
             return '-';
         }
     });
     $this->setComponent(craft(), 'config', $mockConfigService);
     $service = new ImportService();
     $result = $service->slugify($string);
     $this->assertSame($slug, $result);
 }