Contains common import logic
Author: Bob Olde Hampsink (b.oldehampsink@itmundi.nl)
Inheritance: extends craft\BaseApplicationComponent
Exemplo n.º 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);
 }