This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| use Behat\MinkExtension\Context\MinkContext; | |
| class BaseContext extends MinkContext | |
| { | |
| /** | |
| * | |
| * @BeforeScenario @resetDB | |
| */ | |
| public function resetDB(BeforeScenarioScope $beforeScenarioScope = null) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Feature: journey | |
| @mink:goutte_session | |
| Scenario Outline: Sayfaların 200 kontrolleri | |
| Given Aşağıdaki sayfaları ("<url>") kontrol ettiğimde | |
| Then Sayfa http durum kodu ("<status code>") dönmelidir | |
| Examples: | |
| | url | status code | | |
| | / | 200 | | |
| | /yeni-urunler | 200 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| private function invokeRestrictedMethodAndProperties($object, $methodName, $args = [], $properties = []) | |
| { | |
| $reflectionClass = new \ReflectionClass(get_class($object)); | |
| $method = $reflectionClass->getMethod($methodName); | |
| $method->setAccessible(true); | |
| foreach ($properties as $propertyKey => $value) { | |
| $prop = $reflectionClass->getProperty($propertyKey); | |
| $prop->setAccessible(true); | |
| $prop->setValue($object, $value); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ➜ redis-sentinel-sample git:(master) redis-cli -p 26000 | |
| 127.0.0.1:26000> | |
| 127.0.0.1:26000> sentinel master mymaster | |
| 1) "name" | |
| 2) "mymaster" | |
| 3) "ip" | |
| 4) "10.10.10.14" | |
| 5) "port" | |
| 6) "6379" | |
| 7) "runid" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| HTTP/1.1 200 OK | |
| Date: Wed, 29 Apr 2009 20:00:00 GMT | |
| Server: example.org | |
| Content-Type: multipart/batch; | |
| type="application/http;type=1.1"; | |
| boundary=batch | |
| Mime-Version: 1.0 | |
| --batch | |
| Content-Type: application/http;version=1.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| POST /example/application HTTP/1.1 | |
| Host: example.org | |
| Content-Type: multipart/batch; | |
| type="application/http;version=1.1"; | |
| boundary=batch | |
| Mime-Version: 1.0 | |
| --batch | |
| Content-Type: application/http;version=1.1 | |
| Content-Transfer-Encoding: binary |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from drf_haystack.serializers import HaystackSerializer | |
| from drf_haystack.viewsets import HaystackViewSet | |
| from api import models | |
| from api import search_indexes | |
| class SearchModelSerializer(HaystackSerializer): | |
| class Meta: | |
| index_classes = [search_indexes.ModelIndex] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from haystack import indexes | |
| from models import Model | |
| from django.db.models import Min, Max, Avg | |
| class ModelIndex(indexes.SearchIndex, indexes.Indexable): | |
| id = indexes.IntegerField() | |
| text = indexes.CharField(document=True, use_template=True) | |
| transmission_type = indexes.CharField() | |
| fuel_type = indexes.CharField() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Model(models.Model): | |
| STATUS_CHOICES = ( | |
| ('active', 'Aktif'), | |
| ('passive', 'Pasif'), | |
| ('redirected', 'Yönlendirilmiş') | |
| ) | |
| TRACTION_CHOICES = ( | |
| ('front-wheel-drive', 'Önden Çekişli'), | |
| ('rear-wheel-drive', 'Arkadan İtişli'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| HAYSTACK_CONNECTIONS = { | |
| 'default': { | |
| 'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine', | |
| 'URL': 'http://elastic:9200/', | |
| 'INDEX_NAME': 'index?name', | |
| }, | |
| } |