fixtures

CakePHP Unit Testing Fixture Name Conventions Argh?

做~自己de王妃 提交于 2019-12-10 21:39:00
问题 I've been bashing my head against the wall trying to figure out why I can't get my fixture to load properly. When I attempt to run my test, my layout is rendered. If I comment out the fixture, the test runs properly. I've gone over this 100 times and I can't seem to see what's wrong. Heres my Videosview.test.php App::import('Model','Videosview'); class VideosviewTest extends Videosview { var $name = 'Videosview'; //var $useDbConfig = 'test_suite'; } class VideosviewTestCase extends

Install Fixtures in Sylius - Symfony2

a 夏天 提交于 2019-12-10 17:14:05
问题 After having successfully installed and updated all vendors in my project folder for Sylius i tried running this code : app/console sylius:install --fixtures I get this error : PHP Fatal error: Class 'ResourceBundle' not found in C:\wamp\www\sylius\vendor\ symfony\symfony\src\Symfony\Component\Locale\Locale.php on line 51 Then i tried all possible solutions given here Installed intl extension in php (working successfully).Then ran this command php build-data.php 'your ICU version' On running

CakePHP PHPUnit Fixtures Drop Database Table Every Time

大兔子大兔子 提交于 2019-12-10 16:43:11
问题 I am trying to run a simple unit test on my model. The problem is every time I run the test, my database table is dropped. I have public $dropTables = false; Can anyone figure out why the merchant_rejects table is still being dropped? As you will see, I've tried many different methods in my fixture. I guess I will have to step through the code and figure out when the table is dropped. Here is the code for my fixture MovieStarFixture.php: class MovieStarFixture extends CakeTestFixture { // NEW

How to organize fixtures when using pytest

前提是你 提交于 2019-12-10 13:47:49
问题 Fixtures tend to be small and reusable. Given that a specific fixture can rely on other fixtures @pytest.fixture def Account(db, memcache): ... I would like to organize my fixtures in modules, and import them in a specific test-file like so (e.g.) from .fixtures.models import Account Unfortunately this does not seem to work. Instead I always have to import all subordinate fixtures too, e.g. from .fixtures.models import Account, db, memcache What is the better approach to have fine-grained

Symfony2 DoctrineFixturesBundle namespace error

*爱你&永不变心* 提交于 2019-12-10 10:13:45
问题 I have a big problem with the fixtures bundle which I can't resolve. I follow the steps as they are meant to be followed, adding the lines to the deps file, installing them, registering them in the autoload and appkernel. When I try to run even only app/console , it breaks with: Fatal error: Class 'Doctrine\Bundle\DoctrineBundle\Command\DoctrineCommand' not found in /var/www/.../bundles/Doctrine/Bundle/FixturesBundle/ Command/LoadDataFixturesDoctrineCommand.php on line 40 Which seems right

Pytest - Fixture introspect on function level

我与影子孤独终老i 提交于 2019-12-10 09:39:01
问题 I've got a fixture that requires a variable from the test function. Using introspection and declaring the variable in the function namespace/context should work if introspection on function level works, as it does for module level, but each time I run the code I end up with None instead of the string "Fancy Table". In the fixture I set the scope to 'function' and then introspect via getattr and request.function: #conftest.py @pytest.fixture(scope='function') def table(request): from data

Ruby on Rails deleting fixtures with foreign keys

北城以北 提交于 2019-12-09 12:31:27
问题 I'm having trouble setting up the tests with fixtures that use foreign keys! And I would be much appreciated if someone could help me understand this. Let's say for example the :user_type model has a reference to the :role model, when tests get executed, and all the data in the test db is deleted to be again re-inserted, Rails deletes the data from the role model first, instead of deleting the data first from the :user_type and only then from :role . The fixtures: #roles.yml technical: name:

Rails fixtures get table names wrong

萝らか妹 提交于 2019-12-08 20:10:52
I have a roles table, a permissions table, and to join them in a many-to-many relationship a roles_permissions table. In the roles.yml file I have this: admin: name: admin permissions: create_user, edit_user, view_all_users In the permissions.yml I have: create_user: name: create_user description: Create a new user edit_user: name: edit_user description: Edit any user details view_all_users: name: view_all_users description: View all users Now rake test gives me errors saying no such table: permissions_roles: DELETE FROM "permissions_roles" When I comment out the line in roles.yml that

Is there any algorithm to make round robin schedule having each round unique combinations?

可紊 提交于 2019-12-08 13:04:36
问题 Suppose I have an array of 10 participants [1,2,3,4,5,6,7,8,9,10] Assuming a league, as there are 10 participants, so each participant will have 9 matches with other 9 participants. Therefore, there will be 9 rounds having single matches for each participant. For example- Round 1: 1-2, 3-4, 5-6, 7-8, 9-10 [no repeat for any participant] Round 2: 1-3, 2-4, 5-7, 8-9, 6-10 [no repeat for any participant] and so on.. Is there any mathematical algorithmic solution/pattern there? I would like to

Bidirectional references on Doctrine Fixtures

◇◆丶佛笑我妖孽 提交于 2019-12-08 04:21:44
问题 I have a db with movies and awards . The point is what I want is be able to know the movie of an award and the awards of a movie. The problem begins when I try to load a movie or an award. When I load one of them I have an error that says, for example: undefined award-1 or viceversa ( undefined movie-1 ) because the references aren't created yet. My Awards Fixture: namespace MyProject\MovieBundle\DataFixtures\MongoDB; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Common